How to convert a SVG to a PNG with ImageMagick?

I haven’t been able to get good results from ImageMagick in this instance, but Inkscape does a nice job of scaling an SVG on Linux and Windows:

# Inkscape v1.0+
inkscape -w 1024 -h 1024 input.svg -o output.png
# Inkscape older than v1.0
inkscape -z -w 1024 -h 1024 input.svg -e output.png

Note that you can omit one of the width/height parameters to have the other parameter scaled automatically based on the input image dimensions.

Here’s the result of scaling a 16×16 SVG to a 200×200 PNG using this command:

enter image description here

enter image description here

Leave a Comment