Color to alpha in batch

This does the conversion for all PNG files in the current directory. It uses the convert command from ImageMagick.

for i in *.png; do
	convert ${i} \
		-alpha copy -channel alpha \
		-negate +channel -fx '#000' \
		r.png
	mv r.png ${i}
done

Leave a Reply

Your email address will not be published. Required fields are marked *