Convert SVG to transparent PNG with antialiasing, using ImageMagick

Andreas Gohr picture Andreas Gohr · Mar 2, 2012 · Viewed 45.8k times · Source

I want to convert SVG images to PNG files with transparent background and anti-aliased edges (using semi-transparent pixels). Unfortunately I can't get ImageMagick to do the anti-aliasing, the edges always look terrible. Here's what I tried:

convert +antialias -background transparent  in.svg -resize 25x25 out.png

Any ideas or a different command line tool I could use?

Answer

Micah picture Micah · Sep 2, 2013

As a side note, I found that getting transparency was a bit tricky. Instead of using transparent, I had to use none.

convert -background none in.svg out.png