Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I convert SVG image to something raster? Are there any native [command-line] tools on OS X that can do that? I am able to open them in Safari or Firefox, but doing "Save as..." only proposes original (.svg) or web-archive formats and no rasterized image format.

share|improve this question

closed as off-topic by bmike Aug 28 '15 at 21:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 6 down vote accepted

You can do this with Inkscape:

/Applications/ --without-gui --export-png=raster-image.png  source-image.svg

To change output resolution you can set the DPI value:

/Applications/ --without-gui --export-png=raster-image.png --export-dpi=200  source-image.svg

Here are more command line options.

share|improve this answer
inkscape 0.91 current version doesn't seem to display svg images properly, and therefore the conversion to a png is 'correct' as far as this broken inkscape is concerned, but doesn't result in the correct images. YMMV but I would be careful before relying too heavily on inkscape for this purpose. Note that I have used inkscape in exactly this way myself until I've come across an SVG that it breaks on. – Phil Ryan Mar 24 at 6:05

One (wonky) option would be to render it in Safari and take a screenshot of the result, although that's obviously not a good solution.

Sadly there's little SVG support in OS X so far apart from Safari, (the obvious choice for image format conversion) can't render it and I'm not aware of any bundled command line tools that can either.

As for third party command line tools, Homebrew makes Cairo's svg2png as well as the ImageMagick bundle easily available.

share|improve this answer

Try Gapplin. It works for me and creates PNG and JPG files from SVG. Simple and effective.

If you have a lot of SVG files to convert, ImageMagick is probably your best bet.

share|improve this answer - was fastest way for me.
it's not my site.

share|improve this answer
It's not native though... – patrix Sep 5 '14 at 14:00
Absolutely native. Works in any browser and solves the problem. Sure this answer will be useful for somebody. – OZ_ Sep 5 '14 at 18:53

You can work .svg files with the os x version of inkscape which works pretty cool on mac. I've been working with gimp and inkscape instead of adobe photoshop and adobe illustrator for a while and I feel pretty comfortable. Or you can use inkscape just to convert the file...

share|improve this answer
How does this improve on the previous answer – Mark Aug 28 '15 at 20:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.