Page 1 of 1
Join various images to one image based on list!!
Posted: 2018-04-23T04:56:34-07:00
by Cauptain
Guys, I'd like some help.
I have 3 pictures: a.jpg - b.jpg e c.jpg
I want to join all in one photo, like d.jpg = abc.jpg
I know how to do it. I want to know if it works a list with the images (a folder with 30 images or more of each) if it is possible to do.
My images are in the folder.

Any help is very appreciated.
Claudio
Re: Join various images to one image based on list!!
Posted: 2018-04-23T09:53:00-07:00
by fmw42
Please always provide your IM version and Platform. Syntax may vary.
If you make a text file listing 3 image per row, then it can be done by reading the file row by row and extracting the 3 image in the row to combine them. But this is scripting and that would depend upon your OS.
Re: Join various images to one image based on list!!
Posted: 2018-04-23T10:48:26-07:00
by Cauptain
Sorry fmw42. I will remember this in the future.
Windows 10 and last version of ImageMagick (ImageMagick-7.0.7-28-Q16-x64-dll.exe).
Claudio
Re: Join various images to one image based on list!!
Posted: 2018-04-23T12:22:55-07:00
by fmw42
I could do it in Unix, but do not know windows scripting. So perhaps one of the Windows experts can help you on this. It might help if you post a short file with a few rows of your images for experimenting and showing you how to do it.
Re: Join various images to one image based on list!!
Posted: 2018-04-24T02:10:50-07:00
by Cauptain
I can install Unix on Windows 10 and try your script. No problem for me.
Claudio
Re: Join various images to one image based on list!!
Posted: 2018-04-24T09:33:55-07:00
by fmw42
Cauptain wrote: ↑2018-04-24T02:10:50-07:00
I can install Unix on Windows 10 and try your script. No problem for me.
Claudio
You say:
I have 3 pictures: a.jpg - b.jpg e c.jpg
I want to join all in one photo, like d.jpg = abc.jpg
But I am not sure how you want to combine them. Also what is e?
If I assume you just want to append them side-by-side, then you can do it like this.
Image File:
http://www.fmwconcepts.com/misc_tests/c ... gefile.txt
Contents:
lena.jpg spacer.jpg mandril3.jpg
mandril3.jpg spacer.jpg zelda1.jpg
zelda1.jpg spacer.jpg lena.jpg
Input:
Code: Select all
i=0
while read img1 img2 img3; do
convert $img1 $img2 $img3 +append result$i.jpg
i=$((i+1))
done < imagefile.txt
Results:
Note: your file names have spaces in them. So you must enclose them in double quotes in your text file; otherwise, it will try to read each part of the name as a separate file, since the space is the delimiter for the read command. There are ways to get around that by setting the Internal Field Separator to something else, such as a comma or tab. But I won't go into detail unless you say the quoting won't work for you.