Page 1 of 1

Problem on converting svg to png

Posted: 2008-07-13T10:48:03-07:00
by abreu
Hi. First of all let me thank the developers for the great piece of software that is ImageMagick. It is very useful.

I'm having a problem converting this svg:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.0">
	<polygon
		points="0,0.283454 3.18392,0.468029 6.53593,0 7.20171,0.784443 9.01121,0.715227 9.88794,2.52802 9.29136,2.96638 9.29136,4.48253 9.88794,4.9209 9.01121,6.73368 7.20171,6.66447 6.53593,7.44891 3.18392,6.98088 0,7.16546"
		style="opacity:1;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"/>
</svg>
The generated png is cropped at the bottom. However several polygons are correct which is strange because they are all generated with the same command:

convert -density 3000 piece0.svg piece0.png

I also tried rsvg with -width and -height instead of -density and the result was the same.

Any ideas?

Re: Problem on converting svg to png

Posted: 2008-07-13T20:25:22-07:00
by anthony
The above converts fine with...

Code: Select all

convert -density 3000 -size 10x10 msvg:polygon.svg x:
Though the rsvg code seems to have more problems as one point seems to be missing from its output. I don't think the SVG is quite complete as IM complains of a missing 'size' if that option is not provided. Normally the size will be set within the SVG somewhere.

Re: Problem on converting svg to png

Posted: 2008-07-14T14:00:25-07:00
by abreu
I solved my issue by increasing the size of the polygons. The pngs were perfect and sharper (although slower conversion). I usually dont include "size" on the SVGs, I thought the polygon points were enough since they displayed correctly (most of them).
Now Im looking into <animateMotion> :) . Thanks for the answer.