Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert SVG to PNG in Ruby

Tags:

ruby

png

svg

I need to convert SVG content to a raster image (preferably a PNG) in a RoR app. Is there a direct method that doesn't involve ImageMagick, or is this the de facto standard?

like image 680
rslite Avatar asked Jul 28 '09 08:07

rslite


1 Answers

Generally, ImageMagick is considered the de facto standard. It's been tied into so many languages by now that it shouldn't even be a hassle to use. The ruby binding seems to be called rmagick.

That said, you could of course load and render the SVG yourself, perhaps with the ruby bindings for librsvg (never used that successfully though), and using ruby-libpng to store it as a png.

What's an RoR app though?

like image 96
falstro Avatar answered Sep 30 '22 11:09

falstro