Page 1 of 1

possible bug convert SVG to PNG path is filled

Posted: 2013-10-16T07:12:27-07:00
by atdepott
I am trying to convert an SVG image to a PNG using the latest version of ImageMagick (6.8.7 Q16) but I am running into difficulties with rendering a path element. I am using the default SVG renderer (not RSVG). Here is the command I am using:

Code: Select all

convert svgtest2.svg svgtest2.png
and here is the content of my SVG file:

Code: Select all

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="480">
  <path transform="matrix(1,0,0,1,0,0)" fill="none" stroke="#E01B5D" d="M110,129 L180,342 L250,252 L390,67" stroke-width="2"></path>
</svg>
The resulting png should be pink lines with no fill, but I actually see a filled black triangle with no border.
I am very new to ImageMagick so I apologize if this is actually user error. My eventual goal is to convert SVG to PNG using Magick.NET and I will have very limited permissions in the production environment, so I would prefer to use only the default SVG renderer that comes with ImageMagick if possible.

Re: possible bug convert SVG to PNG path is filled

Posted: 2013-10-16T15:20:11-07:00
by snibgo
You need to specify opacities:

Code: Select all

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="480">
  <path transform="matrix(1,0,0,1,0,0)"
   fill-opacity="0" stroke-opacity="1"
   fill="none" stroke="#E01B5D"
   d="M110,129 L180,342 L250,252 L390,67" stroke-width="2"></path>
</svg>

Re: possible bug convert SVG to PNG path is filled

Posted: 2013-10-17T05:55:08-07:00
by atdepott
Thanks, that solved my problem!