Page 1 of 1

Merging Images

Posted: 2015-05-22T03:23:52-07:00
by AntonioKovacevic
Hello people.

I am new to the ImageMagic and I require your help. I have a folder of images 0-9_0-13.jpg. First number is column and second one is a row.
I'm using this command to merge those images together:

Code: Select all

E:\315\001_files\12>montage.exe -tile 1x14 [0-9]_[0-13].jpg miff:- | convert.exe - +append final.jpg
The image comes out all scrambled. The image should look like this:

Code: Select all

0x0   1x0   2x0 ... 9x0
0x1   1x1   2x1 ... 9x1
0x2   1x2   2x2 ... 9x2 
...   ...   ...   .
0x13  1x13  2x13   9x13
If anyone could help me I will greatly appreciate it.

Re: Merging Images

Posted: 2015-05-22T03:43:25-07:00
by snibgo
I think montage will find the files in lexicographical (dictionary) order: 0_0.jpg, 0_1.jpg etc. Is that the order they come out?

Re: Merging Images

Posted: 2015-05-22T03:57:31-07:00
by AntonioKovacevic
This is the result of the above mentioned command: https://dl.dropboxusercontent.com/u/11218705/final.jpg
And this is the result of this command: https://dl.dropboxusercontent.com/u/112 ... inal_1.jpg

Code: Select all

montage -tile 1x10 [0-9]_[0-9].jpg miff:- | convert - +append final.jpg
I guess this only works if image is 1:1 ratio, ignoring the spacing between images.

Re: Merging Images

Posted: 2015-05-22T04:05:03-07:00
by snibgo
Your results support my theory. In dictionary order: 0, 1, 11, 12, 13, 2, 3, 4, ...

You should use numbers with leading zeros: 00, 01, 02, ... 09, 10, 11, 12, 13.

Re: Merging Images

Posted: 2015-05-22T04:27:12-07:00
by AntonioKovacevic
File names go 00x00, 02x05, 09x11.. I get an error No such file or directory. What am I doing wrong?

Re: Merging Images

Posted: 2015-05-22T07:25:49-07:00
by AntonioKovacevic
Thank you. This command worked:

Code: Select all

montage.exe -mode concatenate -tile 1x14 [0-9]*_[0-9]*.jpg miff:- | convert.exe - +append final.jpg
Anybody knows a way to bulk rename files from X_Y to X_0Y, if the second number is not bigger than 10? BulkRenameUtility + RegEx maybe?

Figured it out

Code: Select all

(\d{1})_(\d{1}).jpg
\1_0\2