Page 1 of 1

SVG to PNG convertion problem

Posted: 2009-02-18T08:01:26-07:00
by abp
I'm having problems with the <linearGradient> SVG tag. The below source gives unexpected output.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 width="13px" height="13px" viewBox="0 0 13 13" enable-background="new 0 0 13 13" xml:space="preserve">
<path fill="#FFFFFF" d="M6.5,12.3955078c-3.2514648,0-5.8955078-2.6445313-5.8955078-5.8955078
	c0-3.2514648,2.644043-5.8955078,5.8955078-5.8955078c3.25,0,5.8955078,2.644043,5.8955078,5.8955078
	C12.3955078,9.7509766,9.75,12.3955078,6.5,12.3955078L6.5,12.3955078z"/>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="3.043457" y1="3.043457" x2="9.9570827" y2="9.9570827">
	<stop  offset="0" style="stop-color:#88BB09"/>
	<stop  offset="1" style="stop-color:#5B8424"/>
</linearGradient>
<circle fill="url(#SVGID_1_)" cx="6.5004883" cy="6.5" r="4.8891602"/>
</svg>
Expect something similar to:
Image

With ImageMagick-6.4.9-4-Q16 I get:
Image

Any ideas as to how to solve this?

thanks in advance

Re: SVG to PNG convertion problem

Posted: 2009-02-18T08:04:25-07:00
by magick
Gradient support is not complete in ImageMagick. Are you running under Linux? If so, download / install the very latest ImageMagick release, 6.4.9-4 and it should fix the problem. If you are running under Windows, it will not render properly.

Re: SVG to PNG convertion problem

Posted: 2009-02-18T08:53:18-07:00
by abp
Sadly I run windows. Will use an embedded image until the gradient feature is ready.

Any idea when the gradient support will be done?

Thanks.

Re: SVG to PNG convertion problem

Posted: 2009-02-18T09:55:32-07:00
by magick
We do not currently have an ETA on enhanced gradient support within ImageMagick.

Re: SVG to PNG convertion problem

Posted: 2009-02-26T19:27:28-07:00
by anthony
That SVG file also seems to behave differently with RSVG than with MSVG
and I do not mean shape or gradient.

The RSVG output has a weird extra circle of dots around the green circle, which does not exist in the internal MSVG handling.

Compare...
convert -density 500 source.svg show:
with
convert -density 500 MSVG:source.svg show:

on an IM with RSVG compile-time support.

The line is at the interface between the gradient and the background which you can see when you apply

convert -background red -density 500 t show:

I do not see this effect with the command "rsvg-view" so it must be cause by how IM is overlaying the RSVG output on to the background.