Page 1 of 1

Batch compose with alpha overlay

Posted: 2010-11-17T09:34:12-07:00
by supawolo
I have a massive amount of images where each image is split into two files: X.jpg X.png, Y.jpg Y.png, Z.jpg Z.png, and so on. The jpg file contains the image information whereas the png file is the to-be-alpha mask. I want to overlay the two images to create one image with an alpha mask. The following command does the trick:

convert X.jpg X.png -alpha Off -compose Copy_Opacity -composite X.tga

Is there a convenient way to batch this without a for loop, which, given my total number of images, would take forever?

Thanks.

Re: Batch compose with alpha overlay

Posted: 2010-11-17T11:11:46-07:00
by GreenKoopa
I'm not clear on the question. To get all image pairs processed, won't they have to be all looped over one way or another?

Re: Batch compose with alpha overlay

Posted: 2010-11-17T11:31:59-07:00
by fmw42
you will need to use a script or see some of the unix commands (or windows equivalent) for working with multiple images at http://www.imagemagick.org/Usage/basics/#mogrify_not since mogrify will only process one image at a time from a directory but not a pair of images (see http://www.imagemagick.org/Usage/basics/#mogrify)