1

So basically I use a png image in two different versions. First by just opening it in Inkscape and storing it as svg, for the second by clicking "convert to pattern" and then storing as svg. The first looks like this in the file:

 <image
 width="1280"
 height="720"
 preserveAspectRatio="none"
 xlink:href="data:image/png;base64,iVBOR..."
 id="image10"
 x="0"
 y="0" />

and the second like this:

<defs
     id="defs6">
    <pattern
       patternUnits="userSpaceOnUse"
       width="1280"
       height="720"
       id="pattern4157">
      <image
         y="0"
         x="0"
         id="image10"
         xlink:href="data:image/png;base64,iVBOR..."
         preserveAspectRatio="none"
         height="720"
         width="1280" />
    </pattern>
  </defs>
  <sodipodi .../>
  <rect
     style="stroke:none;fill:url(#pattern4157)"
     width="1280"
     height="720"
     x="0"
     y="0"
     id="rect4160" />

Now, if I export both svg files as png using inkscape, the first one is identical with the source png, the second one becomes a tiny bit blurry, the color also seems ever so slightly darker and also the filesize shrinks from 1.7MB to 1.3MB. Why does this happen? How can I avoid this?

Mircode
  • 432
  • 5
  • 12

1 Answers1

0

It might have to do with the size of the image? Did you check that both files after the second conversion were the same pixel size?

That being said, it seems a bit strange to me that you would use Inkscape, which is designed for vectorial graphics, to mess around with converting pixel-based images into a format that is made for vectorial graphics again, and back.

Gunee
  • 431
  • 3
  • 16
  • Good idea! But yes, the results have the same size. Here you can see what I do with it: https://stackoverflow.com/questions/47714939/workflow-for-creating-animated-hand-drawn-videos-encoding-difficulties I have a png as blackboard background and I use paths with blackboard-pattern to make it look like I erase chalk with a sponge. – Mircode Dec 12 '17 at 22:58
  • You could have a look at https://stackoverflow.com/questions/11293026/default-background-color-of-svg-root-element, so that you can set the black background directly in svg. – Gunee Dec 12 '17 at 23:06
  • The thing is, now that I finally pinned down where the flickering in my animation comes from, I can fix it by just always using patterned shapes instead of es. So it all becomes a tiny bit blurry. But I will always know that I have settled for an imperfect workaround ;) – Mircode Dec 12 '17 at 23:11
  • The background is not black, it's a picture of a blackboard like the thing that hangs in front of a classroom. – Mircode Dec 12 '17 at 23:12