Page 1 of 1
Resources on supported SVG properties...
Posted: 2007-03-05T20:00:36-07:00
by kpettit
I am looking for documentation on using IM to convert SVG's to ...
Can anyone point me?
I am specifically looking for:
* Font Support
* Filter support
* Masking
* Gradients
Thanks,
Ken...
Re: Resources on supported SVG properties...
Posted: 2007-03-05T20:18:34-07:00
by anthony
See IM examples (link in sig)
Especially look in the 'Drawing' section.
Re: Resources on supported SVG properties...
Posted: 2007-03-05T22:09:15-07:00
by kpettit
Thanks,
Does this mean that SVG is not yet supported? From what I'm finding I will need to
parse the SVG then pass commands to IM to recreate the file.
ie. Read the SVG...:
Code: Select all
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="5cm" height="4cm" viewBox="0 0 500 400"
xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect class="Border" x="1" y="1" width="498" height="398" />
<path class="SamplePath" d="M10,30 C10,4 50,30 S90,55 90,30" />
</svg>
Then create IM command:
Code: Select all
convert path_cubic_canvas.gif -fill none -stroke black \
-draw "path 'M 10,30 C 10,4 50,4 50,30 S 90,55 90,30' " \
path_cubic.gif
instead of:
This is a simple example... The SVG files I want to convert can be rather complex. Would rather not
add the additional scripting and processing if I could help it.
So is there any other documentation as to what SVG properties are supported? Or should I create a PHP SVG to IM command library?
Thanks,
Ken...
Re: Resources on supported SVG properties...
Posted: 2007-03-05T22:18:15-07:00
by anthony
IM will read SVG files directly. It handls then in two different ways depending on your system.
It may use the librsvg libraries to convert the SVG to a raster image, OR it converts it itself to the MVG drawing commands format. The later however is still incomplete with regards to gradients and a few other things, but this is being worked on.
What you see in the IM examples is the MVG drawing format. There is also some talk about the SVG format which is why I directed you to that page.
try this...
Code: Select all
convert -density 100 image.svg image.png
You can also use x: instead of image.png to display the result directly on an X window display, is you are in a UNIX environment.