Combine multiple JPEGs into one

4

I have folder of JPEG files named 0_0, 0_1, 1_0, 1_1, etc. First number is column and second one is row. I want to combine them into one JPEG file. How would I go about doing this? I have looked into ImageMagick but I don't know what parameters to use and how.

CodeBreaker

Posted 2015-05-21T11:17:36.857

Reputation: 161

Answers

2

The solution is

montage.exe -mode concatenate -tile 1x14 [0-9]*_[0-9]*.jpg miff:- | convert.exe - +append final.jpg

Note: If you have pictures with double-digit number (4_15, 10_1), You must add a zero to the files with numbers from 0-9 (04_15, 10_01)

This RegEx will take care of that (Bulk Rename Utility)

Search: (\d{1})_(\d{1}).jpg 
Replace: 0\1_0\2

CodeBreaker

Posted 2015-05-21T11:17:36.857

Reputation: 161

2

Relevant ImageMagick documentation is here.

Try:

montage -geometry +0+0 0_0.jpg 0_1.jpg 1_0.jpg 1_1.jpg output.jpg

Mike Fitzpatrick

Posted 2015-05-21T11:17:36.857

Reputation: 15 062

Since I have images from 0_0 to 9_13, it wouldn't be efficient to write out everything. In the mean time I've figured it out montage.exe -mode concatenate -tile 1x14 [0-9]*_[0-9]*.jpg miff:- | convert.exe - +append final.jpg and renaming all X_0-X_9 to X_00-X_09 with this RegEx Search: (\d{1})_(\d{1}).jpg and replace: \1_0\2 – CodeBreaker – 2015-05-23T09:18:15.373

@AntonioKovačević, that sounds like a good solution. You should create it as an answer and then mark it as accepted. – Mike Fitzpatrick – 2015-05-24T00:43:13.523