Merge images side by side from two folders with the same name

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jarrao
Posts: 3
Joined: 2018-03-28T02:55:46-07:00
Authentication code: 1152

Merge images side by side from two folders with the same name

Post by jarrao »

Sorry for noob question but im just starting with imagemagick.
I have two folders with ".jpg" files , "folder1" and "folder2"
I want imagemagick to merge all the files with the same name and create a new ".jpg" on "folder3" or wathever.

Folder1

Image

Folder2

Image

Folder3

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Merge images side by side from two folders with the same name

Post by snibgo »

What version of IM? What script language (eg bash, or Windows BAT)?

How many images, at what size? Are corresponding images the same size?
snibgo's IM pages: im.snibgo.com
jarrao
Posts: 3
Joined: 2018-03-28T02:55:46-07:00
Authentication code: 1152

Re: Merge images side by side from two folders with the same name

Post by jarrao »

Hi , thanks for the quick replay:

I have installed "ImageMagick-6.9.2-Q16" on "Windows 8.1 x64"

Maybe I have between 200 or 300 images on each folder.
The size on each folder is exactly the same , I mean "400x300px" on "folder1" for all the jpgs, "200x300px" on "folder2" for all the jpgs and then should be "600x300" on "folder3"
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Merge images side by side from two folders with the same name

Post by snibgo »

Then it's the same answer as I gave in a recent thread (but I can't find). Windows BAT script:

Code: Select all

for %%F in (folder1\*.jpg) do convert folder1\%%~nF.jpg folder2\%%~nF.jpg +append folder3\%%~nF.jpg
There are other methods that read all the inputs in a single command, so may be faster, but they are more complex.
snibgo's IM pages: im.snibgo.com
jarrao
Posts: 3
Joined: 2018-03-28T02:55:46-07:00
Authentication code: 1152

Re: Merge images side by side from two folders with the same name

Post by jarrao »

Thanks again , so... as I want to learn how imagemagick works , what about if I want to create a composition setting a png on the right , named like the other two jpgs?
I mean "folder1" , "folder2" and a new "folder3" with "pngs" maybe with "150x50px" (the name of the pngs is the same of the folder 1 , and folder 2).
And create something like this on a "folder4"

Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Merge images side by side from two folders with the same name

Post by snibgo »

snibgo's IM pages: im.snibgo.com
Post Reply