3

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?

4

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

enter image description here

Here's an example SVG

  • 1
    It's also possible to do this per image. Right-click on image, select 'Object Properties', and select the 'Optimize Speed' option in the 'Image rendering' dropdown. In addition to this, the pdf renderer needs to support this rendering mode. A trick would be to make a bitmap copy of the enlarged, blocky picture (Edit > Make Bitmap Copy). The dpi value for this can be set in the preferences at Edit > Preferences > Bitmaps > Create. Make it large :) – Moini Aug 7 '18 at 20:31
  • Great, confirmed both this and @Moini's method seem to work both in inkscape and saving as pdf. Thanks! – Sanjay Manohar Aug 19 '18 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.