Imagemagick: Fails to handle translucency when converting SVG to PNG

Created on 11 Apr 2016  路  4Comments  路  Source: ImageMagick/ImageMagick

When converting an SVG image with translucency to PNG, conversion takes place without any translucency. A live example of the problem can be demonstrated here:

SVG source image:
http://cube.crider.co.uk/visualcube.php?fmt=svg&size=200&co=30&co=12&fo=50

PNG destination image:
http://cube.crider.co.uk/visualcube.php?fmt=png&size=200&co=30&co=12&fo=50

ImageMagick's convert binary is being called with the following parameters:
convert -density 600 -resize 200x200 -background none srcfile.svg -channel RGBA -alpha set -quality 100 -define png:format=png32 dstfile.png

The server is running: ImageMagick 6.9.3-0 Q16 x86_64 2016-01-13

An older deployment of the server running ImageMagick 6.7.x used the following command:
convert -background none srcfile.svg dstfile.png
And converted the image perfectly.

enhancement up for grabs

Most helpful comment

Clearly a bug. Will work on getting patch within the next week or two. Thanks.

All 4 comments

Until we can get a patch to fix the ImageMagick SVG internal renderer, download / install inkscape. ImageMagick will prefer inkscape over the internal renderer and return translucent panels as expected.

I'm very interested in this too. There are many scenarios where it isn't realistic to run inkscape on a server, since it will pull in undesired desktop dependencies.

Clearly a bug. Will work on getting patch within the next week or two. Thanks.

This issue appears to be fixed in the latest release of ImageMagick.

Was this page helpful?
0 / 5 - 0 ratings