Combining 2 images into one using batch and action

S
Posted By
sandysmall
Aug 11, 2007
Views
338
Replies
3
Status
Closed
I have hundreds of jpg photo files downloaded from a digital camera. I want to resize and combine 2 4.5×6 jpg files into one 4×6 jpg file containing 2 photos, each 3×4. Then I can upload them and get them printed by a photo printing service.

Since there are so many, I want to automate the process.

I created a separate action to convert all the files into 3×4 size, and ran in as a batch, so that part is done.

Next I created an action "Two 3×4 to 4×6" that opens a file, rotates the image, increases the canvas size to 4×6, opens another file and rotates, selects, copies and closes it, then pastes it into the 4×6 and moves it so both images are side by side, then saves it.

When I run the "Two 3×4 to 4×6" action using batch, it works on the first image (rotating and converting to 4×6) but the second file pasted in is always the same. So I end up with different images on the left side of the processed 4×6 jpg (what I want) but the right side image is always the same one.

I need the second image file opened to procede to the next image file the way the first one does.

Is there a way to open files from 2 separate folders when running a batch, or to open every other file in a folder?

Or do you have any other suggestions? Thanks!

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

DR
Danny_Raphael
Aug 12, 2007
Forget for the moment about being able to get Batch to open files from multiple folders or every other file or the like. Batch just ain’t that smart… The JavaScript gurus would be able to script a solution, but that puts the "solution building" into the hands of someone else.

What will work (I just tried it) and is something you could do is the following. It’s based on the ability to invoke an action with Batch against "pre-opened" files. (Note Bath Source option "Open Images") Although a bit clunky, it might work for you.

Suppose you have 2 open images named A and B and that B is the active image and last in the Window > Documents list.

Your action would go something like this in CS, CS2. (e-mail me if you have PS7 or CS3) * Canvas size: 100% wider (or taller) as needed
* Select previous document (A)
* Select > all
* Edit > copy
* File > close (no save)
* Edit > paste (new layer)
* Select > all
* Layer > align to selection > [whatever option so pasted layer is in the right place] * Layer > Flatten
* File > Save as… (.jpg, specify any folder at this point, do NOT change the file name), specify .jpg options, OK
* File > Close [no save]

STOP recording

——————-

To test the batch process, open an even number of test images. 4-6 would be fine.

File > Automate > Batch
* Action [the one just recorded]
* Source: Open Images
* Destination: Folder (browse to \destination of your choice)

(X) Override action ‘save as’ commands [trust me on this]

Click OK and away you should go.

===================

Options for "pre-opening" files:
* Photoshop File > Open
* -or- Drag/drop from Explorer window into PS window
* -or- Create an action with [literally] no steps. Invoke it in Batch (Source: Folder, Destination: None). Result: Files from \source opened into PS window. Works great.

How many files at a time? Depends on how much RAM you have. You’ll need to experiment.

You’ll need to come up with a system to keep track of files finished and those yet to do.

"What if I have an odd # of images for a run?" You could duplicate any of the open images and optionally "fill it with white."

===================

Hope this gets you moving.
AD
Andrei_Doubrovski
Aug 12, 2007
sandysmall,
Try to make it in 2 goes.

– First, prepare images in one folder (rotate > resize > extend canvas).

– Then (with all the edited images open) run the second batch: open image from another folder > rotate > resize > copy > close new image > paste > flatten > save and close the printable image
S
sandysmall
Aug 12, 2007
It did finally occur to me to try it in two batch steps, just as in Andrei’s suggestion. And it works very well, except that the images are no longer grouped the way they are in Windows. The second batch starts with the most recently opened canvas, and so the first image is grouped with the last one, the second with the second to last, and so forth.

I tried re-ordering the files in Windows, but it didn’t seem to have an effect. I also tried selecting the first image before running the second batch, but it only worked on the first one, and didn’t affect the order of the rest.

It seems that Danny’s suggestion would process the files in the order they are opened, so they wouldn’t end up in order.

I have close to 2000 images, so it is worth it to take the time to automate this. So I guess I will keep trying different options. I sure am learning alot about actions and batch processing that I didn’t know before. I have CS2, btw.

Thanks so much for your suggestions!

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections