Page 1 of 1

Convert using InkScape svg to png

Posted: 2013-08-14T21:37:24-07:00
by Ohpyx
Hi (first post here, let me know if there's anything I can do to improve)

I'm trying to use ImageMagick to convert SVG to PNG. I'd like to end up using PHP's Imagick to do so but for now I'm just trying to get it to work through convert.

CentOS 6.4
ImageMagick 6.5.4-7 2012-05-07 Q16

SVG is currently being rendered through RSVG when using the convert command as shown in convert -list format but I'd like to use InkScape to do the rendering instead of RSVG

According to http://www.imagemagick.org/script/formats.php:
ImageMagick utilizes inkscape if its in your execution path otherwise RSVG. If neither are available, ImageMagick reverts to its internal SVG renderer. The default resolution is 90dpi.
Inkscape is installed and typing inkscape at command line outputs:
Nothing to do!
but when doing

Code: Select all

convert test.svg test.png
it's clearly not using inkscape (no text on path), whereas if i render with inkscape it does show.

is there something I'm missing to get this to render through inkscape and not RSVG?

Re: Convert using InkScape svg to png

Posted: 2013-08-14T22:11:55-07:00
by fmw42
I do not think that was available before IM 6.7.9-0 according to the changelog at http://www.imagemagick.org/script/changelog.php


2012-08-14 6.7.9-0 Cristy <quetzlzacatenango@image...>
Prefer inkscape for best SVG compliance.
Utilize inkscape if it is in your execution path otherwise RSVG. If neither is available, revert to the internal SVG renderer.


Also Imagick has not kept up with changes to Imagemagick and so may be more limited in its features such that this is not possible in Imagick. But I really do not know that much about doing such conversion with Imagick

You will have more flexibility using PHP exec() if you can, but IM 6.5.4.7 is very ancient and lacking many new features.

Re: Convert using InkScape svg to png

Posted: 2013-08-14T23:35:43-07:00
by Ohpyx
Thanks for pointing out the changelog, I should have checked there first.

This is exactly what i was looking for. I assumed that imagick used convert somewhere on the back end but that was a random guess at best.

for now I will look into using passthu and /dev/stdout and jump off imagick for this job.

Thanks for the gracious help

Re: Convert using InkScape svg to png

Posted: 2013-08-15T07:15:27-07:00
by snibgo
On Windows and a recent version of IM, if I put Inkscape's directory on the PATH, convert will automatically use Inkscape.