How Can I Batch Adjoin Multiple Images From Two Folders?
How Can I Batch Adjoin Multiple Images From Two Folders?
How can i batch adjoin series of Images from two different folders? The images are named like 0211100001, 0211100002, 0211100003, and so on for one group in folder A and Images in folder B carry same names as those in folder A. I need to combine corresponding images carrying same name across the two folders so that original content of both images are displayed side-by-side.
I am looking for a a GUI tool or script that can batch it for me by looping through all file with similar names and joining them to a form a single image displaying content from original Images side-by-side. Corresponding files from both folders
don't have same dimension. I like to think of it as involving a one-to-one name-based mapping of many images from two different folders.
I am looking for a a GUI tool or script that can batch it for me by looping through all file with similar names and joining them to a form a single image displaying content from original Images side-by-side. Corresponding files from both folders
don't have same dimension. I like to think of it as involving a one-to-one name-based mapping of many images from two different folders.
Last edited by Sibrah on 2014-04-23T06:21:23-07:00, edited 2 times in total.
Re: How Can I Batch Adjoin Multiple Images From Two Folder?
What is your operating system?
Re: How Can I Batch Adjoin Multiple Images From Two Folder?
dlemstra, Operating system is Windows7. If i have a script or solution for other windows OS, then i will be willing to consider a brand new OS installation. Thanks
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How Can I Batch Adjoin Multiple Images From Two Folder?
It could be something like this:
Tested in Windows 8.1, but probably fine for Windows 7, Windows XP, etc.
Code: Select all
set FOLDER_A=\blah\blah
set FOLDER_B=\another\blah
set FOLDER_OUT=\out_blah
for %%F in (%FOLDER_A%\a*.png) do (
if exist %FOLDER_B%\%%~nxF %IM%convert %%F %FOLDER_B%\%%~nxF +append %FOLDER_OUT%\%%~nxF
)
snibgo's IM pages: im.snibgo.com
Re: How Can I Batch Adjoin Multiple Images From Two Folder?
snibgo, I tried your script but didn't get no results.I changed four things -
(1). The Folder for Folder A
(2). The folder for Folder B
(3).The Output Folder and
(4). The file extension .png to .jpeg and didn't get a result.
I am suspecting the commands -enjoin, all my search effort so far points to the -enjoin keyword. I hardly understand the syntax, though i have a strong feeling i can do what i want with little modification.
(1). The Folder for Folder A
(2). The folder for Folder B
(3).The Output Folder and
(4). The file extension .png to .jpeg and didn't get a result.
I am suspecting the commands -enjoin, all my search effort so far points to the -enjoin keyword. I hardly understand the syntax, though i have a strong feeling i can do what i want with little modification.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
What messages do you get?
I searched for "a*.png". Change that as you need, for example "*.jpg" for "*".
"-enjoin" isn't an ImageMagick keyword. Where did you find it?
I searched for "a*.png". Change that as you need, for example "*.jpg" for "*".
"-enjoin" isn't an ImageMagick keyword. Where did you find it?
snibgo's IM pages: im.snibgo.com
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
i got no messages after executing the said script in ImageMagick dir from command prompt. I must confess i am lost here. From which environment did you run the script? Please help a ImageMagick/Graphics newbie. i really need this solution.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
I provided a Windows BAT script, to be put in a file and run. If you want to type it at the prompt, change each double percent %% to single percent %.
snibgo's IM pages: im.snibgo.com
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
Did it that way, Still no luck. Thanks for the effort so far, i was expecting a simple script that i can easily pinpoint where to substitute my Images folders directories, output directory and image name patterns but it seems i can't work with your script or maybe i am not ImageMagick ready. All the same, Thanks alot for the wonderful try.snibgo wrote:I provided a Windows BAT script, to be put in a file and run. If you want to type it at the prompt, change each double percent %% to single percent %.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
Take it one step at a time. What is your version of IM? Have you renamed the Imagemagick convert.exe to say imconvert, so it does not interfere with the Windows convert
Try a simple operation with one image from each folder (assuming jpg format). Copy and past this into your Command Window
where folderC must already exist and folderA and folderB have your two jpg images and the path is the full path from the disk (presumably C:). Use suffix .png, if your input images are png.
Does this work? If not, what kind of error message do you get.
Note I am not a Windows user, so any Windows user should feel free to correct any errors I have made in the above.
Try a simple operation with one image from each folder (assuming jpg format). Copy and past this into your Command Window
Code: Select all
imconvert path2folderA\image1.jpg path2folderB\image1.jpg +append path2folderC\image1.jpg
Does this work? If not, what kind of error message do you get.
Note I am not a Windows user, so any Windows user should feel free to correct any errors I have made in the above.
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
FMW42, i tried ur code and got an error message like:
this unable to open image [image dir/image.jpg]
this unable to open image [image dir/image.jpg]
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
Always post your full command as well as it could have a simple syntax error which could be the problem.
If this is the path to your input image: image dir/image.jpg then the space between image and dir could be the problem. Try using this instead "image dir/image.jpg"
If this is the path to your input image: image dir/image.jpg then the space between image and dir could be the problem. Try using this instead "image dir/image.jpg"
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
I assumed you were on windows and thus I believe you should be using backslashes and not forward slashes. I am not a windows user, so someone else should correct my syntax.Sibrah wrote:FMW42, i tried ur code and got an error message like:
this unable to open image [image dir/image.jpg]
As Bonzo said, it is best to provide you exact command line to be sure there are no other typos.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
On Windows, IM accepts forward slashes / as well as back slashes \. I think it is better practice to use the usual Windows convention of backslashes.
Certainly, best to show us the exact command (and exact error message).
Also try very simple commands like:
What does "convert -version" say?
Certainly, best to show us the exact command (and exact error message).
Also try very simple commands like:
Code: Select all
convert -version
convert rose: r.png
convert r.png r.jpg
snibgo's IM pages: im.snibgo.com
Re: How Can I Batch Adjoin Multiple Images From Two Folders?
I was able to run this code successfully:
I placed the pictures 0220100001.jpg and 0220100001[].jpg into the ImageMagick directory and it generated a result.jpg file. i am trying to figure out how to advance and represent my file names properly in snibgo script. My file are named like 0220100001, 0220100002, 0220100003 and so on in both folders so that 0220100001.jpg in folders A gets joined to 0220100001.jpg in folder B, however i still haven't figured out how to related that part with the command prompt script.
The part below is the portion of the code i am finding difficult to figure out
Code: Select all
imconvert 0220100001.jpg 0220100001[].jpg +append result.jpg
The part below is the portion of the code i am finding difficult to figure out
Code: Select all
for %%F in (%FOLDER_A%\a*.png) do (
if exist %FOLDER_B%\%%~nxF %IM%convert %%F %FOLDER_B%\%%~nxF +append %FOLDER_OUT%\%%~nxF
Last edited by Sibrah on 2014-04-28T10:43:52-07:00, edited 3 times in total.