2

I have thousands of images where I need to add a border onto. I've been trying to automate this tedious process but I don't seem to succeed at it. I've been playing around with the automate, actions and image processor feature.

These are the steps I've done manually to create the result I'd like with 1 image.

  1. Create a new document with 13 cm width by 10 cm height
  2. Change the white background into a black background
  3. Load the image onto the canvas (by dragging) note: it will automatically center
  4. Save the image

Original example: Wikipedia

End result example:

enter image description here

Hopefully someone can explain to me which steps I need to take in order to automate this.

EDIT:

  1. The most important thing is that all of the images are centered in the middle, the border size itself doesn't really matter so it basically needs to full up the space. That's why I was using the background itself as a border instead of adding a rectangle manually.

  2. Most of the images are the same size but not all of them, same of them are made with an older camera.

    I also separated the horizontal and vertical photo's. I could've rotated all of them but that seems to be more time consuming than separating them.

  3. The canvas size must be 13 width and 10 height for horizontal photo's and 10 width and 13 height for vertical photo's. The photo will always be centered in the middle so that it will created borders on two sides.

4
  • There is a very simple way of achieving this but I need to know: 1) Are you trying to add the same border size to all the images? 2) Are the images of different sizes? 3) What is the finished size you need to achieve if they are all the same proportion crops?
    – user45605
    Oct 11, 2015 at 21:00
  • @John, As I understand from your answers, you want the canvas size to be 13x10 or 10x13 and the image shrink to leave borders around. This will leave uneven borders on different size images, you realize this I suppose. What is a typical pixel dimension? What is the DPI set at? Ir is very simple to add borders around the images, say 50 (or 87, or any number of) pixels on all sides. Will that be an acceptable solution for you? Or must you end up with 10x13 or 13x10 finished size regardless of the actual size of the images?
    – user45605
    Oct 13, 2015 at 0:24
  • 1
    @John, Do you have Lightroom, which will make this even simpler.
    – user45605
    Oct 13, 2015 at 0:30
  • @John, I forgot to add that Lightroom solution will only yield JPEG flattened images, if you have Lightroom and high quality JPEG is OK, then it is a piece of cake!
    – user45605
    Oct 13, 2015 at 1:33

2 Answers 2

1

This is not exactly the proper way but I've managed to do it this way:

1) Create a duplicate folder with all the images that you would like to frame and place it somewhere you'd be able to easily find it. If you have both portrait and landscape shots, you would have to separate it into two different folders.

2) In photoshop, open the first image from the folder you have just made by the selecting File > Open, or use the shortcut cmd + o or ctrl + o.

3) Open the Actions panel located on the sidebar or through Window > Actions, and click on the folder icon to create a new set (just to be safe and have it be more accessible) and name it accordingly. Then on the new set you've made, create a new action by clicking the page icon, name the action accordingly and begin recording. I left the function key as none to lessen any complications.

4) When this is done, the action would've begun recording and you can see the red recording dot. Begin the first action by by creating a new layer and filling it with a black background.

5) Unlock the image layer and move the black background layer to the bottom.

6) Then, select the image layer and access the transform panel by the cmd + t shortcut and right click to select scale. Adjust the vertical scale variable at the top column to a percentage that you are comfortable with. Make sure to adjust the horizontal scale variable by the same percentage so that your image does not warp and then hit Enter to make your selection.

7) Activate the crop tool (make sure cropping option is set at unconstrained) and adjust the horizontal sliders to crop away the black strips at the side and hit enter to make your selection when you are happy with the cropping followed by flattening the layers together.

8) At this point, you can stop recording the action and close the image WITHOUT saving any changes.

9) When there are no files open, Select File> Automate > Batch and it will bring you to an batch option dialog. Choose the set and action that you have named accordingly as well as the source folder (the duplicated folder you made it in the beginning). Leave all the other options unchecked. For Destination > Select Save and Close and check the "override action save as command" option. When you are ready, click Ok and the automation will begin and you can go on to do other tasks.

I hope this has been helpful and would appreciate asl wel if anyone could come up with a more "correct" procedure or easier way to it.

0

Here is an alternate approach in which you need to treat the portrait and landscape oriented images separately but the process is the same. Before you start, you need to decide on:

  1. The resolution, or DPI since without it centimeter measurement is meaningless, I will use 300dpi in this example but take your pick
  2. A suitable pixel size for the border, which may be bigger depending on the actual image size, I will use 10 pixels on all sides in this example

Now you need to calculate the finished image size. I created a blank document 13 x 10 centimeters at 300DPI (note that the resolution is in dot per inch) and it resulted in an image 1535 x 1181 pixels. This will be the finished image size. Since I want a standard 10 pixels on all sides, I will need to subtract 20 pixels from the finished image size to find the maximum pixel dimensions for the actual images. That yields a maximum image size of 1515 x 1161 pixels. We are now ready to get down to business. (By the way, to create the blank image I did, simply go to File/New and then enter the width and height in centimeters and resolution in Pixels/Inch and you will have the same thing.)

As the previous answer suggested, create copies of these images in a separate folders organized by portrait and landscape orientation. I will explain the landscape image handling process but you can easily transpose the numbers for the portrait oriented images.

  1. Open the first landscape oriented image
  2. Start recording an action, name it to indicate the landscape image set, YOU MUST start the action after opening the image at this point.
  3. Go to File/Automate/Fit image as shown in the image set below
  4. For the dimensions enter 1515 width and 1161 height in pixels and make sure to put a check mark in the box next to "Do not enlarge". See the image in the set below
  5. Image will be fit into this window, scaled down ONLY if needed
  6. Press Shift-Ctrl-S to save As, and choose an empty folder, in my example I chose a folder in D:\Dummy\batch\ and note this location
  7. If you are saving a JPEG file, you will see a quality setting window, choose a setting you would like
  8. Click OK to save the image
  9. Click Ctrl-W to close the image
  10. Stop recording the action, just to make sure you are starting with a clean folder, delete the only file in the destination folder so it is empty once more
  11. Now you can process all your landscape oriented images in a batch. Go to File/Automate/Batch
  12. In the dialog window, enter the Action Set, then the Action name using the drop-down lists. Select "Folder" for the source. Click on Choose to navigate to where all your images are. Select "Folder" for the destination. Click on Choose to navigate to the empty folder. MAKE SURE to put a check mark in the box next to Override Action "Save As" commands. You will see a warning, just ignore it. File naming can remain as Document Name + Extension
  13. Click OK to process all the images and saved in a new folder.

Whewf!

Now the second phase of the process. Opening the images and making the canvas size 13x10 cm at 300DPI. I am going to suggest and use a separate folder yet for the processed images, lets call it batch2 and create it before you start.

  1. Open the first process image from the "batch" folder
  2. Start recording a new action, name it properly for landscape
  3. Go to Image/Canvas Size and in the window enter the pixel dimensions of 1535 x 1181, make sure thecenter point is selected on the 3x3 grid, for background color choose Black. Click OK. Now you will see your image centered on a black background having minimum of 10px border all around.
  4. Press Shift-Ctrl-S to invoke Save As, navigate to the new blank folder batch2 and save it
  5. Press Ctrl-W to close the file
  6. Stop recording the action and go delete the single file from the batch2 folder
  7. Go to the File/Automate/Batch and in the window choose the right action, source "Folder" and make sure to choose the processed files folder "batch" in my example. Destination "Folder" choose the new destination folder "batch2", put a check mark to Override Actin "Save As" commands.
  8. Click OK and let it rip!

You will now have a new collection in the batch2 folder all your images with black borders and perfectly centered. Now repeat the process for portrait oriented images.

If you have Lightroom, the process will be much quicker and in one step.

Here are the images from this session for you to compare your settings.

enter image description here enter image description here enter image description here enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.