You can try ImageMagick:
convert input.gif -transparent white output.gif
For more complex functions, you should try something like masking images, or do it manually using any image library, setting the pixel values ββto something with a high alpha value.
See also this topic: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10665
Shezi
source share