473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 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 3451
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: R.Marquez | last post by:
Does any one know of a way to convert PDF documents into a raster format, such as TIFF or JPEG? Of course to do it in Python would be my preference, but if you know of another way to do this...
1
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases...
2
by: John Palmer | last post by:
Hi all, This may be a stupid question here, but I need to be able to convert a SVG document into any kind of raster format (PNG, JPG, BMP, GIF, whatever). The catch is that, tho I have a good...
1
by: paul | last post by:
library for querying virtual polygon over raster spatial data in my c++ application, after calculating my polygon i wish to define it (simple 4 sided polygon with floats or line parameters) and...
1
by: John Tempest | last post by:
Please help. I got no response to my previous query "?Using raster fonts as graphics in dotNet?" posted on 7th July. The principal question remains: How can I (if I can at all) select a raster...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
4
by: Nick K. | last post by:
Is there any native ,Net assemblies or open C# source code that can perform vector to raster conversion?
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
7
by: dave | last post by:
Hi All. I've been formulating in my head a simple image editor. I actually started prototyping is some time ago in Java, but am liking Python more and more. My editor will be nowhere near the level...
4
by: alarock | last post by:
hi, I have performed some drawing using Vector image,DrawRectangle etc... and then i converted to raster Image(bitmap) i found in the zoomed raster image(bitmap) the outer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.