Search code examples
imagemagickalpha-transparency

How to add Alpha -channels en masse with ImageMagick?


Suppose a dir with a lot of images, some of them miss the alpha-channel so looking bad against a background. I thought every picture had alpha -channel but some pictures now show white instead of having transparency. How can I add the alpha channels en masse?

Not Working

$ convert imageNoAlpha.png -alpha on imageAlpha.png


Solution

  • This will change white to transparent as in you coment BUT any other white in the image will be transparent as well:

    convert input.jpg -background none -transparent white -flatten output.png