converting xcf > png: alpha channel lost

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
vico

converting xcf > png: alpha channel lost

Post by vico »

I dont know if this is a bug, converting an xcf with transparency give me a png with black background.

The command i tried was:
"convert test.xcf test.png"
and
"convert -flatten test.xcf test.png"

Im i doing something wrong??
It seems that imagemagick don't recognize the alpha channel of the xcf format.
With "identify -verbose test.xcf" it only reports RGB channels, and if i save the image as png from gimp, the same command reports RGBA.

Any idea on how to get transparency from xcf?

thanks

vico

(sorry for mi bad english)
vico

Re: converting xcf > png: alpha channel lost

Post by vico »

anyone??
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: converting xcf > png: alpha channel lost

Post by anthony »

-flatten not only merged multiple layers together but also uses a starting canvas of the current -background color setting.

If unset that setting comes from the image file, if that format does not have such a setting or no image has been read in, it is set to white.

If you want it transparent, set it to 'none' or 'transparent'.

See Im examples, Layering, Flatten
http://imagemagick.org/Usage/layers/#flatten
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
angelaf

Re: converting xcf > png: alpha channel lost

Post by angelaf »

Any other thoughts on this issue? -background transparent did not work.
Specifically, I'm having problems maintaining the transparent Alpha channel using a convert command from .sgi to .png

Help appreciated! :)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting xcf > png: alpha channel lost

Post by snibgo »

Can you post a link to the xcf file so we can try it?
snibgo's IM pages: im.snibgo.com
angelaf

Re: converting xcf > png: alpha channel lost

Post by angelaf »

http://www.prism.gatech.edu/~afritz3/dr ... _RADAR.sgi

As I said, it's an SGI file. Apologies, not sure if that's really in the same category as an xcf...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting xcf > png: alpha channel lost

Post by fmw42 »

I am no expert on sgi files, but when downloading or trying to view it, it appears to be a txt file. So I changed the type to .sgi and got this

identify -verbose BANNER_HD_RADAR.sgi
identify: improper image header `BANNER_HD_RADAR.sgi' @ error/sgi.c/ReadSGIImage/347.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: converting xcf > png: alpha channel lost

Post by magick »

We have a patch in ImageMagick 6.5.9-9 Beta to fix this problem. The patched distribution will be available sometime tomorrow.
angelaf

Re: converting xcf > png: alpha channel lost

Post by angelaf »

Thank you!
Last edited by angelaf on 2010-02-21T01:34:27-07:00, edited 1 time in total.
angelaf

Re: converting xcf > png: alpha channel lost

Post by angelaf »

fmw42 wrote:I am no expert on sgi files, but when downloading or trying to view it, it appears to be a txt file. So I changed the type to .sgi and got this

identify -verbose BANNER_HD_RADAR.sgi
identify: improper image header `BANNER_HD_RADAR.sgi' @ error/sgi.c/ReadSGIImage/347.
I apologize, I should have known that posting it to web wouldn't have worked.
Post Reply