What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Trying to align two images side by side, hopefully in a way so I can batch process.


jackhulk

Member
Messages
17
Likes
5
Hello

Using CS6, I have two images that I will like to align side by side, then process 100's of images in a batch process. I know how to record an action, but I just don't know how to complete this action of joining two images side by side.

The first images is always the same size, 89x600px
The second image's height remains constant (600px), but width varies slightly from image to image.

I'd like to position the first image to the left of the second image, not overlapping, but to the other side of it's edge, so you can see both images, in full, side by side with no space in-between them.

I've Googled this problem to death, but all my searches have taught me, is that Photomerge doesn't work properly "Some images could not be automatically aligned". This is probably due to the fact that these are completely unrelated separate images, which are not to be part of merged panoramic. Also learnt that Layer align (edge to edge) requires at least three layers (but I only have two), and so I'm ran out of ideas.

While I know how to align manually, I'll like to record action and run as batch as I've got many images to join. Therefore if the canvas needs to be re-sized in order to accompany both images side by side (as I do via manually joining), then I also need to learn if it's possible to automate canvas re-size.

Any help would be much appreciated, thank you.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Look in the help files for Variables and Data Sets. Set the pixel replacement method to As-Is and set the alignment to place the 2nd image to the right of the first. It should work for what you've described.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Hi hawkeye

Thanks for your reply. I tried what you advised, but unfortunately that hasn't worked, as the first image is simply place on top of the other. Maybe I've gone wrong somewhere though as the results are no different than from using Layer > Align > Left Edge.

Here's what I need. This was done manually (re-sizing canvas, cropping etc), but remember I need to batch process and the large game cover image width various, so if canvas re-sizing is required, this will need to be automated if possible?

4X4-Evo-2-Xbox.jpg

This is all I can achieve with Photoshop so far.
4X4-Evo-2-Xbox-photoshop.jpg

Any other suggestions please, or perhaps a step by step guide for your previous suggestion if you think I've gone gone with that?
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Looks like as newbie I don't have rights to edit posts. I mean "gone wrong with that?"
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Hey Jack, I'm not that well versed in batch processing and some of the more advanced features of Ps that might help you out with your sizing situation when referring to an action.

When I come across a question like this, I start searching for answers. If I find one I will surely share. I'm certain someone here will have a solution for your situation, it just may take awhile before they come along.

edit: Not that I think hawks answer is not the solution, I just have not yet figured out what he was referring to!
 
Last edited:
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

I was watching this video:

http://www.youtube.com/watch?v=nNGsYUrW6MU

Remember, this may not be the easiest or most elegant way to do this, but it is an idea.

In the action, create a canvas that is pushed to the right. Make sure that the increase will cover the widest of any of the varied sized images you plan to use.

Make the next step in the action, after the merge, to be IMAGE > TRIM > TRANSPARENT PIXELS.

As I said, simple but maybe not the best! Just an idea.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

No worries, IamSam, thanks for your input anyways. I'm sure someone will have a solution like you say. It's seems a pretty straight forward task, never thought it would be so difficult.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Make sure to set define the variable on it's own layer and set the alignment. In this case it's Layer 1, then assign data sets for the replacement files. I just did a simple yellow rectangle to demonstrate.
So it does work, I've used it many times. But as far as the other aspects of changing the canvas size, I couldn't say if that can be incorporated without a lot of testing first. I'll leave that to you.
 

Attachments

  • ScreenShot002.jpg
    ScreenShot002.jpg
    81.4 KB · Views: 1
  • ScreenShot001.jpg
    ScreenShot001.jpg
    43.3 KB · Views: 0
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Iamsam - I've actually watched that video before as it came up in my searches, but as he was manually creating the exact size canvas for two images he knew the exact width of, I couldn't apply it to my problem where one image width varies.

I like your idea and almost works, but the problem I have now is that while trim remove the excess from the right of cover, space remains between the logo and the cover, and not sure how to remove this? Perhaps it's the way I'm introducing the pictures together as I see you mentioned 'merge', where as I am simply copy and pasting.

Here's what I'm doing step by step...
1. Open logo and extend canvas width.
2. Open cover, select all and copy.
3. Back to logo, I paste, so that now both logo and cover are on the same canvas. Logo is on the far left where it should be, and cover is in the middle of canvas with unwanted space between logo and cover. Trim > Transparent Pixels removes empty space from the right edge of the cover, but this still leaves empty space between right edge of logo and left edge of cover.

hawkeye - Thanks for the images and explanation. I've no doubt this works, but I just cannot get it to work for me. After setting variable, adding that to a set, then selecting Image > Apply Data > Set > Data Set 1, nothing happens. I tried different pixel replacement methods, along with different alignment too, just to test, but regardless of what I tried the layer remains in the exact same position on canvas. I'm clearly going wrong somewhere?

I understand the concept of variables, but it is so confusing to use, particularly for a newbie. I think I'd need a step by step guide on this one (hankeye, anyone, pretty please) :)

I've used PhotoScape in the past to combine images, which is so simply to do, but I use photoshop for everything else so thought I'd try combining images here. Who knew such a seemingly task would prove to be so difficult! I've already spent another 3 hours on this today, and all of last night, so will return to it tomorrow. In the mean time, please keep suggestions coming. Thank you.

[EDIT] Whooha I'm now allowed to edit post! Next thing you know I'LL be help people! :bustagut: One last very important thing I just remembered for me trying to switch! PhotoScape doesn't have option to batch combine! Plus I noticed that my Photoshop outputs were of sharper quality.
 
Last edited:
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Not sure if it will solve the issue, but once you have moved the images together (copy and paste), you should merge the two together (command + E), then use the trim function. Try that and tell me if that works.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Unfortunately did not work. Same problem with empty space remaining between logo and cover.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

OK, I'm back in search mode! I will check back if I find anything!
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

I can't see what you're doing but... On the Variable layer (layer 1 in this case) make a box for the new image to fill. I just used a plain white rectangle but it could be another image. Then set up a Data Set by browsing and selecting the replacement image. As you can see when I apply the Data Set it, fills the white rectangle.
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    86.4 KB · Views: 0
  • ScreenShot002.jpg
    ScreenShot002.jpg
    81.5 KB · Views: 0
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

I don't think data driven graphics is going to work Hawkeye, as Jack has said the right hand document can be various sizes.
It should be a fairly easy job to do with a script though, but more information would be required.
1) What is the format of the imput files (jpg,png ???)
2) Are file1 and file2 in the same folder or in different folders?
3) What is the nameing convention of both files?
4) Does the output files need to be flattened?
5) What file format should the output files be?
6) Where should the output files be saved, is it relative to the input file location?
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

I don't think data driven graphics is going to work Hawkeye, as Jack has said the right hand document can be various sizes.
It should be a fairly easy job to do with a script though, but more information would be required.
1) What is the format of the imput files (jpg,png ???)
2) Are file1 and file2 in the same folder or in different folders?
3) What is the nameing convention of both files?
4) Does the output files need to be flattened?
5) What file format should the output files be?
6) Where should the output files be saved, is it relative to the input file location?

You could start with a transparent canvas size large enough for the biggest image and use an action to trim the excess. But in the end, a script would likely be a more efficient approach.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Hi all.

hawkeye - I've been try again today to apply what you done with the green and red blocks using the variables. While I have made progress and now seeing actions when I apply data, the position of the layer with variable (cover in this case) does not line up against the logo layer, instead it's positioned against the left edge of the canvas, covering up the logo completely.

Paul MR - A script sounds like just the trick! I'll try and answer your questions as best I can, but if they are wrong or if you need any other details, please let me know.

1) What is the format of the imput files (jpg,png ???)
jpg

2) Are file1 and file2 in the same folder or in different folders?
File 1 (logo) can easily be in any folder it needs to be in. File2 (covers) are all in the same folder.

3) What is the nameing convention of both files?
Not sure what this means, but I'll give example of file names...
Logo = Logo-Game-89x600.jpg
Cover = 4X4-Evo-2-Xbox-.jpg

4) Does the output files need to be flattened?
Not sure of the benefit or disadvantages this would have? The output file needs to be a new file so that the original cover remains.

5) What file format should the output files be?
Save for web jpg, quality 83, all check boxes unchecked.

6) Where should the output files be saved, is it relative to the input file location?
In a completely separate folder.
 
Last edited:
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

First Screenshot:

1) Make sure you add something or use the first picture where the replacement file will go. This acts as the bounding box. I used a white rectangle next to the vertical black box, as I don't have the files you wish to use.

2) Make sure to set the correct alignment. In this case center left.

Second Screenshot
The result when the Data Set is applied. As you can see it aligns with the left side of the white rectangle.

Good luck...
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    80.7 KB · Views: 0
  • ScreenShot002.jpg
    ScreenShot002.jpg
    60.1 KB · Views: 0
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

Hi all!

I get it now, thank you hawkeye! The problem was I was missing step one, so no boundary box was set, which of course resulted in the problem of the cover overlapping the logo.

So finally I'm now able to combine the two images side by side. Step by step here is how...
  1. Open logo layer and extend canvas to right of logo using width size large than largest possible cover width.
  2. Create a boundary box starting from top right edge of logo, covering the rest of the transparent canvas.
  3. Image > Variables > Define > Check 'Pixel Replacement' > Set method to 'As Is' & set alignment to left central, then click next.
  4. Click the icon bar with the little arrow pointing down on it which will 'Create a new data set based on current data set' > Select 'Value' File > I then select my cover and click apply.
  5. Image > Trim > Check 'Transparent Pixels' and the excess canvas is be removed. Now I'm left with cover perfectly aligned along side the logo with all excess removed.
Great stuff! Many thanks all, particularly hawkeye. :thumbsup:

I though job done! Now I just need to record process and run batch, but hit a little snag there. The output file is to be saved in a new directory and I'd like the output files name to be the same as the cover image name, however when I save, the default name is the name of the logo image. Any idea how I can set the output file to save using the variables value name?

[EDIT] Actually thinking about, I'm not so sure if the above process can be run as a batch due to step 4 where each individual cover has to be selected manually. Can anyone figure out if it's possible please?
 
Last edited:
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

You are welcome.
 
Re: Trying to align two images side by side, hopefully in a way so I can batch proces

  1. Open logo layer and extend canvas to right of logo using width size large than largest possible cover width.
  2. Create a boundary box starting from top right edge of logo, covering the rest of the transparent canvas.
  3. Image > Variables > Define > Check 'Pixel Replacement' > Set method to 'As Is' & set alignment to left central, then click next.
  4. Click the icon bar with the little arrow pointing down on it which will 'Create a new data set based on current data set' > Select 'Value' File > I then select my cover and click apply.
  5. Image > Trim > Check 'Transparent Pixels' and the excess canvas is be removed. Now I'm left with cover perfectly aligned along side the logo with all excess removed.
Great stuff! Many thanks all, particularly hawkeye. :thumbsup:

I though job done! Now I just need to record process and run batch, but hit a little snag there. The output file is to be saved in a new directory and I'd like the output files name to be the same as the cover image name, however when I save, the default name is the name of the logo image. Any idea how I can set the output file to save using the variables value name?

[EDIT] Actually thinking about, I'm not so sure if the above process can be run as a batch due to step 4 where each individual cover has to be selected manually. Can anyone figure out if it's possible please?

Still not been able to figure this out. Anyone have any ideas how I can run above process as batch please?
 

Back
Top