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:
1 |
qlmanage -t -s 800 -o . path/to/file.svg |
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:
1 |
brew install imagemagick |
And now for the magical command to convert SVG to PNG:
1 |
convert -background none -resize 300% file.svg file.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.8 out of 5.
How would you rate this article?
★ ★ ★ ★ ★
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?
thank you for sharing, however qlmanage doesn’t scale SVG the same way as using PS or GIMP