png to gif with transparency

gif, imagemagick, png

Solution

What you are doing should work out of box.

However, there's an important limitation of GIF as a format (not related to imagemagick). It does not support semi-transparency (alpha channel). Transparency in GIF is on/off (boolean).

Docs claim that the default behavior is to make pixels with (alpha<50%) fully transparent.

Depending on your image, you may achieve satisfactory results though. For example, by tweaking the threshold (code from ImageMagick docs):

 convert a.png -channel A -threshold 15%   a_no_shadow.gif

See more info on available options at: http://www.imagemagick.org/Usage/formats/#gif

Problem

I have a png image with some transparency. I would like to transform it to a gif image. I have tried imagemagik using `convert myimage.png myimage.gif` but transparency is not respected. Any solution using linux commands? thanks

Original source