Replies: 1 comment 2 replies
-
Wand doesn't parse this data at all, but passes it to ImageMagick that attempts to detect what type of images was given, then passes to a coder / delegate to decode. For SVG, it can be rsvg, msvg, or inkscape.
Correct. ImageMagick is a raster tool that can, through delegates, read vector source files. However the encoding chain will always be:
Delegate tools like potrace & autotrace will get the raster to a vector, but the output vector will never 100% match the input vector.
The same black borders show up when calling inkscape directly.
Correction!This could also be due to reading blob data, and not from a file. By passing a SVG fragment, it's possible to skip over portions of the delegates lookups, and result in ImageMagick selecting the internal SVG decoder. If you export |
Beta Was this translation helpful? Give feedback.
-
I'd like to convert a SVG string to a PNG image using Wand. On Linux, this works fine. On macOS, I'm consistently seeing black strokes and other changed styling that shouldn't be there. I have tried the same SVG files with MagickWand, and encountered no issues on either operating system. I describe the issue I'm encountering a little more on Stack Overflow.
What I've noticed is that the SVGs that Wand parses from a string have extra elements. For example, with this script:
The PNG image has a black border:
And the SVG now has an extra
<g>
element containing what I think is supposed to be default styling but I would guess it's causing the black border:The question is, why is Wand adding a black border? I'm seeing the same on other, more complex images but I can't understand why even on this simple example the black border is there.
My setup is:
Beta Was this translation helpful? Give feedback.
All reactions