Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automated fast svg to raster-image (e.g. png) conversion

Tags:

shell

svg

I'm looking for a tool to convert an svg to a raster-image (png for instance) from a shell script (bash).

Currently I use inkscape --export-png=image.png --export-area-drawing image.svg which works well, but is terribly slow.

Searching the Web and SO only gets me libraries to do this inside some programming language (php, js, C#, ...). I could write myself a small program to do this, but I would prefer an existing tool (other than inkscape as it is quite slow).

like image 870
bitmask Avatar asked Jun 18 '11 13:06

bitmask


People also ask

Can SVG files be converted to PNG?

Use Adobe Photoshop to convert SVG images to PNG images. Get lossless compression, preserve image resolution, and lower your file size by converting from SVG to PNG. Use Photoshop for a fast way to turn large file formats into smaller, easier-to-use graphic types.

Is SVG better than PNG?

PNGs and SVGs support transparency — so they're both excellent choices for online logos and graphics. It's worth noting that PNGs are one of the best choices for a raster-based transparent file. If you're working with pixels and transparency, PNGs are a better option than SVGs.

Does SVG create raster images?

Cairo graphics can be converted into vector files as PostScript, PDF, and SVG, can be output on various screen display modes on Linux and Macintosh systems, or can be used to generate raster images.


1 Answers

It is possible using librsvg2

All the details are here

like image 129
ThibThib Avatar answered Oct 10 '22 11:10

ThibThib