Convert using InkScape svg to png

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Ohpyx
Posts: 2
Joined: 2013-08-14T21:24:54-07:00
Authentication code: 6789

Convert using InkScape svg to png

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert using InkScape svg to png

Post 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.
Ohpyx
Posts: 2
Joined: 2013-08-14T21:24:54-07:00
Authentication code: 6789

Re: Convert using InkScape svg to png

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert using InkScape svg to png

Post by snibgo »

On Windows and a recent version of IM, if I put Inkscape's directory on the PATH, convert will automatically use Inkscape.
snibgo's IM pages: im.snibgo.com
Post Reply