I have a series of PNG images with transparent backgrounds that I want to overlay on the destination PNG image, which also has a transparent background. For argumentation, we say that a series of images:
- Source Images: img1.png, img2.png, img3.png
- Target Image: dest.png.
Since I want to overlay all the images at once, I'm going to use the convert
switch command compose
as follows:
gm convert -compose Atop dest.png img1.png img2.png img3.png -flatten output.png
It seems pretty simple, but the problem is that output.png is losing transparency, and I don't know how to enable it. If I use the switch -background
, I can set what transparency was for any color that I want, but I can not get it back to transparency.
Yes, I can subsequently call:
gm convert -transparency black ouput.png output2.png
but then any black in the actual image also becomes transparent.
Any help here?
source
share