SVG / PDF image without interpolation?

I exported an heatmap from Matlab as PDF. If I view the PDF created by matlab print -painters -dpdf command, I see the correct output:

enter image description here

However if I import into Inkscape (either via Poppler or not) with the image gets interpolated and blurred:

enter image description here

When I re-save as pdf, it also looks interpolated. I have noted the svg xml code for the image is like this:

  <image
     y="172.88283"
     x="136.01956"
     id="image2718"
     xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAPZJREFUKJGNkTFuwzAMRZ889SaVoct08G1qIwN9lAwdPPQuhSEfJUOA34GyJScB2g8QEiT+z08SMJGkeubnO9nD5EEWOynr3R+yavIu2JAvUO4HyZoK1ih7JP0cYqZPBZLEuuFYgMHPNPrTOlNR/oCOdYMczyTqcSZB0gfYSHBrf2EAizDNmG5M20y1ahG+SqV+PvPSiLezu9qtpgjT1jo6Y30QYmmtNv39A93rEkOdagsbyboCEMoySbqzhm/qINoVNYI5wgABk2oSL5K9kucsh0AHcKH3AbGQdMd0Kz17G3mMZddV+LBqujKFN1cfgL6twMNK4Bdchqf6VbHBwQAAAABJRU5ErkJggg=="
     preserveAspectRatio="none"
     height="198.95876"
     width="185.10374" />

When I export to PDF from Inkscape, it also looks similarly blurred.
Any idea how to make it look like the original PDF above, after editing in inkscape?

Answer

Change the Bitmap scale (image rendering) in the preferences to Blocky(optimizeSpeed)

enter image description here

Here’s an example SVG

Attribution
Source : Link , Question Author : Sanjay Manohar , Answer Author : Billy Kerr

Leave a Comment