Page 1 of 1

turn off antialias on svg export

Posted: 2008-08-21T09:06:08-07:00
by whiskybar
I have been unable to turn off antialiasing when converting SVG to PNG. Is the following line correct?

Code: Select all

convert +antialias drawing.svg drawing.png
The source svg is a very simple image created with inkscape: http://lurkingideas.net/media/drawing.svg.

If you look at the result png image http://lurkingideas.net/media/drawing.png, it is still anti-aliased. It should contain two or three colors but there are 414 colors instead.

What am I missing here?

Thank you very much
Jiri

Re: turn off antialias on svg export

Posted: 2008-08-21T12:39:29-07:00
by fmw42
don't know much about SVG, but have you tried putting +antialiasing after the input svg file?

Re: turn off antialias on svg export

Posted: 2008-08-21T12:55:06-07:00
by el_supremo
The drawing.svg file gives a 404 Not Found error

Pete

Re: turn off antialias on svg export

Posted: 2008-08-21T13:06:56-07:00
by whiskybar
fmw42: good idea. I just tried that but it didn't work either though.

el_supremo: sorry about the 404. I have fixed that.

I was wondering if you got the same result - the same PNG. It is anti-aliased, isn't it? Is it correct behavior? What should +antialias do if not prevent this from happening?

Jiri

Re: turn off antialias on svg export

Posted: 2008-08-21T17:01:19-07:00
by anthony
+antialias should be given BEFORE reading the SVG file.

What result (and how good it is) you get depends on if your IM was built to use the RSVG delegate library or the internal MSVG processing.

See IM examples, drawing, SVG Handling for more details of RSVG and MSVG
http://www.imagemagick.org/Usage/draw/#svg

Hey did you know that if you compile the latest IM with the autotrace development library installed, IM can generate SVG from raster images???? Of course the image should be as large as posible and preferable simplified to reduce shapes and colors.

Re: turn off antialias on svg export

Posted: 2008-08-22T01:33:09-07:00
by whiskybar
anthony, a spot-on explanation

This also explains why the PNG created by the rsvg utility were the same as if they were created by IM. Thank you very much for your answer.

Re: turn off antialias on svg export

Posted: 2008-08-24T16:22:07-07:00
by anthony
whiskybar wrote:This also explains why the PNG created by the rsvg utility were the same as if they were created by IM. Thank you very much for your answer.
The RSVG library delegation is used as it is a more correct implementation of the SVG drawing, where the MSVG converts SVG to MVG drawing methods.

Unfortunately MVG does not have the color gradient handling added to it as yet, though it is supposed to only need the appropriate linking in.