list of implemented SVG elements?
list of implemented SVG elements?
I'm using PHP and building SVG images which are displayed in the browser. I also want to save the SVG as a png or jpg file.
For the most part this works with some of the basic SVG elements such as circle, rect, polygon, path, etc... Unfortunately when I apply a filter, such as <feGaussianBlur> the image looks fine in the web browser however the blur is not applied when I read the SVG with imagick and attempt to write a png.
I'm looking for a list of SVG elements https://developer.mozilla.org/en-US/doc ... VG/Element which imagemagick is actually able to read and apply.
For the most part this works with some of the basic SVG elements such as circle, rect, polygon, path, etc... Unfortunately when I apply a filter, such as <feGaussianBlur> the image looks fine in the web browser however the blur is not applied when I read the SVG with imagick and attempt to write a png.
I'm looking for a list of SVG elements https://developer.mozilla.org/en-US/doc ... VG/Element which imagemagick is actually able to read and apply.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: list of implemented SVG elements?
Imagemagick uses a delegate library to read SVG files. There are 3 you can use: Inkscape, RSVG and the internal Imagemagick MSVG. You should use one of the first two as they are more functional that the internal MSVG (xml). You can check which you are using by
and see what is listed for SVG. For example, I have
SVG SVG rw+ Scalable Vector Graphics (RSVG 2.40.2)
but Inkscape may be even better.
Code: Select all
convert -list format
SVG SVG rw+ Scalable Vector Graphics (RSVG 2.40.2)
but Inkscape may be even better.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: list of implemented SVG elements?
Of the three, Inkscape implements the most features. It is also the slowest. Sadly, Inkscape documentation is incomplete and out of date. There doesn't seem to be a list of supported SVG features. It implements most SVG standard 1.1 elements, and some draft standard 1.2.
There is a list of filter effects implemented since Inkscape v0.46: http://wiki.inkscape.org/wiki/index.php/Filter_Effects
There is a list of filter effects implemented since Inkscape v0.46: http://wiki.inkscape.org/wiki/index.php/Filter_Effects
snibgo's IM pages: im.snibgo.com
Re: list of implemented SVG elements?
Interesting. I had no idea.
How do I get imagemagick (convert) to use inkscape? I've installed inckscape using homebrew and it is now in my executable path however it still doesn't show up as the tool for converting SVG. Do I need to update a setting somewhere?
I notice that when I list the svg delegate I get this...
svg => "rsvg-convert" -o "%o" "%i"
however listing the format still yields...
SVG rw+ Scalable Vector Graphics (XML 2.7.3)
what is the difference as far as imagemagick is concerned?
How do I get imagemagick (convert) to use inkscape? I've installed inckscape using homebrew and it is now in my executable path however it still doesn't show up as the tool for converting SVG. Do I need to update a setting somewhere?
I notice that when I list the svg delegate I get this...
svg => "rsvg-convert" -o "%o" "%i"
however listing the format still yields...
SVG rw+ Scalable Vector Graphics (XML 2.7.3)
what is the difference as far as imagemagick is concerned?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: list of implemented SVG elements?
"convert -list format" is not a reliable indicator of whether Inkscape will be used. As far as I know, the only reliable method is to convert with "-verbose" and read the output.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: list of implemented SVG elements?
I have not tried to use Inkscape, but I do use RSVG. I get all my delegates from MacPorts and then compile IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202. But to get RSVG rather than XML, I had to add --with-rsvg to my ./configure command. Perhaps you need to add --with-inkscape?
Re: list of implemented SVG elements?
interesting.
When I run convert from the command line with -verbose I see:
So it would appear to be running inkscape.
it does still error out with:
Assuming I can get over this hurdle, I guess the next question is; I am ultimately running this through a php web app, using php compiled with Imagick. If I get this working with imagemagick via convert does that mean it should also work through Imagick, or is that a totally different animal?
When I run convert from the command line with -verbose I see:
Code: Select all
"inkscape" "bozo.svg" --export-eps="/var/tmp/magick-91701yQtvhs1snIyc" --export-dpi="90,90" --export-background="rgb(100%,100%,100%)" --export-background-opacity="1" > "/var/tmp/magick-91701WAfrCDIJp9ZZ" 2>&1
it does still error out with:
Code: Select all
dyld: Library not loaded: /usr/X11/lib/libXt.6.dylib
Referenced from: /Applications/MAMP/Library/bin/gs
Reason: image not found
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: list of implemented SVG elements?
What version of IM are you running? For a while, IM rasterised SVG by telling Inkscape to create EPS files. Then IM would tell Ghostscript to convert the EPS to something that IM could process directly.pumplerod wrote:--export-eps="/var/tmp ...
... Referenced from: /Applications/MAMP/Library/bin/gs ...
More recently, IM tells Inkscape to create PNG files, so GS isn't needed. This is far more sensible.
snibgo's IM pages: im.snibgo.com
Re: list of implemented SVG elements?
thank you snibgo,
I'm using:
I simply ran:
brew install imagemagick
so I'm not sure how to make sure ghostscript is not included. I do see that if I simply convert using inkscape the conversion works.
I'm using:
Code: Select all
Version: ImageMagick 6.8.9-7 Q16 x86_64 2015-03-04 http://www.imagemagick.org
brew install imagemagick
so I'm not sure how to make sure ghostscript is not included. I do see that if I simply convert using inkscape the conversion works.
Code: Select all
inkscape testFile.svg testResult.png
Re: list of implemented SVG elements?
I have not tried on MacOS but is this setting in delegates.xml be your help?pumplerod wrote:How do I get imagemagick (convert) to use inkscape?
http://stackoverflow.com/questions/1132 ... k#12608890
Last edited by 246246 on 2015-08-25T04:38:53-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: list of implemented SVG elements?
Perhaps you should try upgrading IM, An install would also make sure it sees Inkscape if it is installed correctly.ImageMagick 6.8.9-7