simon ransome wrote:
GIF transparency is supported by stealing one of the available palette entries (IIRC), out of the up-to 256 available. Therefore, I used to set the "background" to some hideous colour (like a lime green or bright purple) which was unlikely to occur in the rest of the image, and set that to to be the transparent colour.
Been there and done that, and been caught out when trying to generalise!
Looking through the convert options again, it seems this is handled with -transparent vs -transparent-color although I haven't quite worked out how to use them in practise - I found a useful thread here: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=12914
If you convert to PNG, this isn't an issue as it supports proper alpha channels (i.e. variable opacity) thus transparency is simply a pixel of any colour with an alpha-value of 0x00, rather than one of its palette members being assigned "transparent" (or something vaguely like that).
How is the alpha value specified? Eg: If I want to set a colour as white I could use #FFFFFF, but how would I specify white with an alpha value of (say) 50%?