Page 1 of 1

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

Posted: 2009-10-08T08:50:53-07:00
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

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

Posted: 2009-10-12T07:00:22-07:00
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.

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

Posted: 2009-10-12T09:25:46-07:00
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