How to convert a specified colour to transparent for a series of PNGs with ImageMagick?

I’ve installed ImageMagick on Windows 7 64-bit and I’m wondering how I can convert a series of PNGs to transparent PNGs in a timely manner (I have 180 PNGs to convert, so yeah I can’t exactly do them each individually if I ever want to have spare time again).

How can I quickly edit the transparency of a colour for a batch of PNGs using ImageMagick?

Answer

If the color of the original background is fixed (e.g. white), you can simply use convert for all your images (see also here):

convert input_image.png -transparent white output_image.png

If you don’t want to use a batch file, you can use mogrify, being aware that mogrify overwrite the original file.

This question is very frequent in StackExchange: for example this question or this other question.

Attribution
Source : Link , Question Author : Josh Pinto , Answer Author : Community

Leave a Comment