Transparency problems, SVG to PNG, 6.5.5-10 vs. 6.5.6-1

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
haetorigami

Transparency problems, SVG to PNG, 6.5.5-10 vs. 6.5.6-1

Post by haetorigami »

Hi.
I'm converting SVG to PNG on a server running FreeBSD 7.0 and IM 6.5.5-10.
The generated PNG image shows opaque white background under elements, which are not meant to have one: Image-notice background under the tiger. However, when I'm doing the same with IM 6.5.6-1 locally, everything is correct :Image.
Is it a version problem (even though IM 6.5.5-10 is the latest release for FreeBSD) or something is wrong with the settings? Concerning the settings - the hosting company says they can not retrieve any IM conf file to look through 'cause they've only installed Command-Line Tools.

Thanks
haetorigami

Re: Transparency problems, SVG to PNG, 6.5.5-10 vs. 6.5.6-1

Post by haetorigami »

Hi guys.
I still don't have a single clue :( . Maybe, the problem is with the SVG file. It consists of another SVG, included as an image. As I've already mentioned, I get white background even though that inserted SVG image doesn't have one. I'm converting SVG to PNG.

Code: Select all

<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" height="181" width="281"><circle r="100" cy="100" cx="100" transform="matrix(1.2414265871048 0 0 1.2414265871048 16.3573412895203 -33.8426587104797)" fill-opacity="1" fill="#ff6600" />
<image preview="http://****.***/flash/clipart/preview/Fauna/tiger.swf" xlink:href="http://****.***/flash/clipart/svg/Fauna/tiger.svg" height="509.7" width="493.95" y="0" x="0" transform="matrix(0.355110853910446 0 0 0.355110853910446 45.7464968554676 0.999998880922803)" />
</svg>
This is the conversion command:

Code: Select all

convert -flatten -channel RGBA -colorspace RGB -background none -quality 80 -depth 8 file.svg file.png
Thank you for help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Transparency problems, SVG to PNG, 6.5.5-10 vs. 6.5.6-1

Post by fmw42 »

I am not an expert at svg, and this may not help, but
convert -flatten -channel RGBA -colorspace RGB -background none -quality 80 -depth 8 file.svg file.png
ty

adding -matte after -colorspace RGBA

Do you have rsvg delegate properly installed?

I am a little puzzled why you are flattening the file to background none. But try putting background none before -flatten

convert -colorspace RGB file.svg -channel RGBA -matte -background none -flatten -quality 80 -depth 8 file png

or

convert file.svg -channel RGBA -matte -colorspace RGB -background none -flatten -quality 80 -depth 8 file png
Post Reply