471,353 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

SVG to raster conversion.

Does anybody know a good solution (preferably in python) for rasterizing
SVG or other vector graphics.

I'm thinking something like

vector_image = SVGFile(path_to_image)
raster_image = vector_image.rasterize(format, (width, height), dpi)
raster_image.write(out_file)

Thanks for any pointers you might have.
Sep 16 '07 #1
3 3321
J. Cliff Dyer wrote:
Does anybody know a good solution (preferably in python) for rasterizing
SVG or other vector graphics.

I'm thinking something like

vector_image = SVGFile(path_to_image)
raster_image = vector_image.rasterize(format, (width, height), dpi)
raster_image.write(out_file)

Thanks for any pointers you might have.
The GIMP can do it, and you can even program it in Python.

Stefan
Sep 16 '07 #2
Stefan Behnel wrote:
J. Cliff Dyer wrote:
>Does anybody know a good solution (preferably in python) for rasterizing
SVG or other vector graphics.

I'm thinking something like

vector_image = SVGFile(path_to_image)
raster_image = vector_image.rasterize(format, (width, height), dpi)
raster_image.write(out_file)

Thanks for any pointers you might have.

The GIMP can do it, and you can even program it in Python.

Stefan
Thanks. I can't find a gimp-python package for gimp-2.x anywhere
though. Do
es such a thing exist?
Sep 16 '07 #3
J. Cliff Dyer a écrit :
Does anybody know a good solution (preferably in python) for rasterizing
SVG or other vector graphics.

I'm thinking something like

vector_image = SVGFile(path_to_image)
raster_image = vector_image.rasterize(format, (width, height), dpi)
raster_image.write(out_file)

Thanks for any pointers you might have.
Another link to complement other replies:

Maybe witgh Cairo:

Library:
http://cairographics.org/

SVG support:
http://cairographics.org/manual/cairo-SVG-Surfaces.html

Python binding:
http://cairographics.org/bindings/
A+

Laurent.
Sep 17 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by R.Marquez | last post: by
1 post views Thread by Stub | last post: by
2 posts views Thread by John Palmer | last post: by
1 post views Thread by John Tempest | last post: by
11 posts views Thread by Steve Gough | last post: by
4 posts views Thread by Nick K. | last post: by
2 posts views Thread by Alex Sedow | last post: by
7 posts views Thread by dave | last post: by
4 posts views Thread by alarock | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.