tags:

views:

178

answers:

1

We have some code that draws things using RVG in RMagick. We scale them at various sizes. What I'm trying to do is use a file that's saved as an SVG as a template.

The problem is, is when I load an SVG using Magick::Image.read, and then 'use' it, it rasterizes it, and then scales it, instead of producing pretty vectors.

Is there a way one might go about doing this properly?

Thanks!

+2  A: 

Thoughts:

  1. Imagemagick is fundamentally raster oriented. If you want to keep your image in vector format, don't use Imagemagick, as the author will tell you. That said, even though imagemagick may by default convert your image to raster, you can convert it back from raster into vector format (sometimes).
  2. SVuGy may help. It doesn't appear to have a lot of support, but may work. I haven't used it.
  3. The rmagick developer claims to have a SVG to RVG parser, you might try contacting him at rmagick AT rubyforge DOT org.
  4. If all else fails, punt. You could write an xslt to convert your svg to rvg. The two formats are close enough that this might not be too painful. Else a tool like genshi might be a faster conversion path for you if you know more python than xlst.
DaveParillo
I also realized it's not very easy to go from RVG to SVG. I'm surprised it can't store a syntax tree and output SVG as well. I'd love to use python for most of this stuff, but we're a ruby and not a lot of time to investing in learning new techs or something.Thanks for the input
mikelikespie