Offset when rasterizing SVG to lowres

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
abp

Offset when rasterizing SVG to lowres

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Offset when rasterizing SVG to lowres

Post 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)
abp

Re: Offset when rasterizing SVG to lowres

Post 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?
RonE

Re: Offset when rasterizing SVG to lowres

Post 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.
abp

Re: Offset when rasterizing SVG to lowres

Post 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
Post Reply