I have a series of PNG images with transparent backgrounds that I want to overlay onto a destination PNG image that also has a transparent background. For argument sake let's say that the series of images are :
- Source images : img1.png, img2.png, img3.png
- Destination image : dest.png.
Since I want to overlay all the images at once, I am going to use the convert
command, with the compose
switch as follows :
gm convert -compose Atop dest.png img1.png img2.png img3.png -flatten output.png
Seems simple enough, but the problem is that output.png looses it's transparency and I do not know how to keep it enabled. If I use the -background
switch I can set what used to be the transparency to any color I want, but I cannot get it to go back to transparency.
Yes, I can subsequently call:
gm convert -transparency black ouput.png output2.png
but then any black on the actual image becomes transparent as well.
Any help here?