Page 1 of 1

Convert multiple files for the same code

Posted: 2016-03-31T11:16:01-07:00
by Doomme
Hi guys,

I'm a newbie. I don't know how to coding, and i'm using imagemagick in window x64.
So, please make the answer clear and easy to understand, thanks!

Here is my question,
i have 3000 images (They are 1500 pages of the ebook) and that are the same size. I need to combine them in pairs, putting them side-by-side.
I find the same question in stackoverflow forum, this link:
http://stackoverflow.hex1.ru/questions/ ... ook-layout ,
im trying to now what is bash, try to install nuget....But i don't know how to coding so i can't handle it.
I'm lucky to find this code:

Code: Select all

convert myfile1.jpg myfile2.jpg +append Done1.jpg
to combine 2 photos, and it was amazing so far.
But it only handle 1 command with 2 photos,
Is there anyway to automate this using imageMagick in window? with easy use code?
i lost 2 days to find answer my own, but i can't find any thing

Regards!

Re: Convert multiple files for the same code

Posted: 2016-03-31T12:04:47-07:00
by GeeMack
Doomme wrote:I'm lucky to find this code:

Code: Select all

convert myfile1.jpg myfile2.jpg +append Done1.jpg
to combine 2 photos, and it was amazing so far.
But it only handle 1 command with 2 photos,
Is there anyway to automate this using imageMagick in window? with easy use code?!
I'm using Windows 7 64 and ImageMagick 6.9.3-6 Q16 x64. Try this...

Code: Select all

montage *.jpg -tile 2x1 -geometry +0+0 Done%04d.jpg
EDITED TO ADD: Also, if the dimensions are all the same, or if you will resize all the images to an exact dimension, something like this should work...

Code: Select all

convert *.jpg -resize 640x480! +append -crop 1280x480 Done%04d.jpg
That brings in all the JPG files in the directory and resizes them all to 640x480 just to make sure they are all the exact same size. Then it appends them into a wide horizontal strip of all the images. Then it crops that strip into separate images which are 1280 pixels, twice the width of the input images. Finally it outputs them as individually named JPG files "Done0000.jpg", "Done0001.jpg", "Done0002.jpg", etc.

Re: Convert multiple files for the same code

Posted: 2016-03-31T22:50:23-07:00
by Doomme
Firstly, thank you!
That's exactly what i want, but i have some issue with this code:

With 8 image, it work totally perfect.
Image

But when im apply for a hundred photos, it's gonna combine like this:
Image

I thought that, Your code work only with photo contain number smaller than 9.

I'm waiting for your respond,
Thanks!
(I'm using Windows 10 64 and ImageMagick 6.9.3-7 Q16 x64).

Re: Convert multiple files for the same code

Posted: 2016-04-01T03:39:59-07:00
by snibgo
Your input filles have names like RHModern1.jpg, RHModern2.jpg, RHModern10.jpg, and so on. You need leading zeroes so the sort order is what you want: RHModern001.jpg, RHModern002.jpg, RHModern010.jpg, etc.

Re: Convert multiple files for the same code

Posted: 2016-04-01T04:49:31-07:00
by Doomme
snibgo wrote:Your input filles have names like RHModern1.jpg, RHModern2.jpg, RHModern10.jpg, and so on. You need leading zeroes so the sort order is what you want: RHModern001.jpg, RHModern002.jpg, RHModern010.jpg, etc.
Offcourse, you're right!

@snibgo; @GeeMack, you guys saved my day, Thank you so much!