·

photo credit: Vive la france via photopin (license)

How to convert SVG to PNG on OSX

Tags: , ,

Here’s a small tip: If you want to convert SVG to PNG on OSX there are several things you could try. One of those is a tiny ‘secret’ app build natively into OSX: qlmanage . This app is used by the system to generate (PNG) thumbnails of your files, but can also be used on the command line:

This will generate a thumbnail of 800 × 800 pixels of path/to/file.svg  in the current directory (. ).

Transparency

Unfortunately, qlmanage  doesn’t deal with transparent backgrounds, so if you need transparency, qlmanage  isn’t the tool you need. In that case, you’re probably better of with ImageMagick.
To install ImageMagick on OSX, install homebrew (if you haven’t already), and install it in the terminal:

And now for the magical command to convert SVG to PNG:

This creates a PNG file of the SVG file with a transparent background and scaled up 300%.

 

Visitors give this article an average rating of 3.7 out of 5.

How would you rate this article?

2 thoughts on “How to convert SVG to PNG on OSX”

  1. Gabriel says:

    Hello and thanks for this tip! I managed to convert an svg to a beautiful png with transparency. Perhaps qlmanage has been updated to handle transparency in Yosemite. Or did you mean it does not handle transparency consistently?

  2. charles says:

    thank you for sharing, however qlmanage doesn’t scale SVG the same way as using PS or GIMP

Leave a Reply