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.
Batch compose with alpha overlay
- GreenKoopa
- Posts: 457
- Joined: 2010-11-04T17:24:08-07:00
- Authentication code: 8675308
Re: Batch compose with alpha overlay
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?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Batch compose with alpha overlay
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)