Page 1 of 1

Offset when rasterizing SVG to lowres

Posted: 2009-12-03T08:59:24-07:00
by abp
Hi All

I am experiencing a strange offset when rasterizing SVG files to low resolutions using ImageMagick 6.5.8. The problem is illustrated below.

I use the following call:

convert -filter blackman -alpha on -depth 8 -background none -resize 100%x100%! redcircle.svg redcircle.png

I've compared with other tools to ensure that what I am expecting is correct. As you can see from the scaled ImageMagick output, there is a topleft offset that become obvious in low resolutions. Since 'convert' ignores '-gravity' and 'geometry offset' wrong parameters that are causing the offset. Am I missing parameters or is this in fact a bug?

SVG Source
http://dl.dropbox.com/u/1760945/redcircle.svg

Org. Rasterized to PNG via Adobe Illustrator CS4:
Image
scaled:
Image

Rasterized to PNG via Batik 1.7 (batik-rasterizer.jar):
Image
scaled:
Image

Rasterized to PNG via ImageMagick-6.5.8-Q16:
Image
scaled:
Image


Thanks in advance!

Re: Offset when rasterizing SVG to lowres

Posted: 2009-12-03T10:38:09-07:00
by magick
Add '-strokewidth 0' to your command line. Are you running on a Linux or Mac system? If so, install the RSVG and RSVG-devel RPMS and rebuild ImageMagick to fix the problem. Make sure 'identify -list format' returns:
  • SVG SVG rw+ Scalable Vector Graphics (RSVG 2.26.0)

Re: Offset when rasterizing SVG to lowres

Posted: 2009-12-04T01:26:06-07:00
by abp
Adding the '-strokewidth 0' parameter did not change a thing I am afraid.

I am using Windows Xp system locally and Windows 2000 Server on my build server. Does your RSVG fixes apply to such setups?

Re: Offset when rasterizing SVG to lowres

Posted: 2009-12-04T04:52:50-07:00
by RonE
abp wrote:Adding the '-strokewidth 0' parameter did not change a thing I am afraid.

I am using Windows Xp system locally and Windows 2000 Server on my build server. Does your RSVG fixes apply to such setups?
Hi,
I tried the same thing and it worked perfectly however I am using Mac. As far as I'm aware RSVG Fixes dont apply to Windows.
Hope that helps.
Ron E.

Re: Offset when rasterizing SVG to lowres

Posted: 2009-12-09T02:23:27-07:00
by abp
RonE wrote:
abp wrote:Adding the '-strokewidth 0' parameter did not change a thing I am afraid.

I am using Windows Xp system locally and Windows 2000 Server on my build server. Does your RSVG fixes apply to such setups?
Hi,
I tried the same thing and it worked perfectly however I am using Mac. As far as I'm aware RSVG Fixes dont apply to Windows.
Hope that helps.
Ron E.
Can anybody verify that the RSVG fixes don't apply to windows? Can anybody think of other possible solutions I can try out?

Thanks

abp