Batch Pair Montage
Posted: 2017-05-17T12:11:07-07:00
Hi,
I have a bunch of images the exact same size that I need to pair together with a 10px gap and a 5px border. They're all in the same folder and named appropriately: Left 0001.jpg, Right 0001.jpg, Left 0002.jpg, Right 0002.jpg, … etc.
After a lot of trial and error I've found that the 'montage' operation works perfectly as a single command, thus:
Now I don't want to have to go through re-running the command for every pairing, so I thought I'd try this:
But of course that just created a single huge image with all of the source images montaged.
So I guess I need to create a batch file (for Windows) and loop through with a wildcard, but I've never done any batch scripting before and I'm not sure where to even start with it. Any help would be greatly appreciated.
I have a bunch of images the exact same size that I need to pair together with a 10px gap and a 5px border. They're all in the same folder and named appropriately: Left 0001.jpg, Right 0001.jpg, Left 0002.jpg, Right 0002.jpg, … etc.
After a lot of trial and error I've found that the 'montage' operation works perfectly as a single command, thus:
Code: Select all
montage -background black -geometry +5+5 "Left 0001.jpg" "Right 0001.jpg" "Frame 0001.jpg"
Code: Select all
montage -background black -geometry +5+5 Left*.jpg Right*.jpg Frame*.jpg
So I guess I need to create a batch file (for Windows) and loop through with a wildcard, but I've never done any batch scripting before and I'm not sure where to even start with it. Any help would be greatly appreciated.