Skip to main content
Chris@LC
Participant
August 25, 2020
질문

Is there a way to add padding to the automated crop and straighten photos?

  • August 25, 2020
  • 2 답변들
  • 9669 조회

I have scans of hundreds of photos, with nice white borders on a black background, that need to be cropped and straightened and would like to use the automated crop and straighten photos tool. BUT I need to leave a border around the photo's edge (10-20 pixels). Is there a way to have that action leave space in its auto crop? I don't want to crop the image and then copy it into a new image to create an artificial border, I need to retain the original background. I'm currently using CS6, but can get access to the newest version of Photoshop if needed. I have attached an example of the original (69348.jpg), the auto crop and straighten (69348auto.jpg), and the way I want it to look (69348proper.jpg).

 

Any help would be greatly appreciated as I will have a lot more like this in the future.

이 주제는 답변이 닫혔습니다.

2 답변

JJMack
Community Expert
Community Expert
August 25, 2020

You example and your process description do not belong to together.

You first image look like you used a flat bed  scanner with a gray background to scan a print at 300 DPI print resolution. images 69348

You Auto process removed gray background straightened the Image a trimmed the Transparency image 69348auto

Your third image is  the auto image with a resized canvas  to make the image the desired 10" x 8" 300 Print size. 69348propper

The canvas Color can be any you want.

 

The was no cropping done there would be no borders added if the scan print was  10" x 8" paper  size can camg ams net bi be a perfect 10" by 8" in this case the canvas was sized up 101.46% of the scan sizeled the 1.5%. 

 

Action can not use logic to deal with image size.  Actions are recorded Photoshop steps the step are record on a single size document and the steps are record for that size image.  If all you scans are not of 10" x 8"  prints.  You will either need to use Photoshop scripting to deal with Image size, or record an action for each scan print size and batch process one print size size scan at a time. 

JJMack
Chris@LC
Chris@LC작성자
Participant
August 25, 2020

Thanks for the comments, but I wanted to clarify a some things. Yes, I used a flat bed scanner with a gray background to scan a print at 300 DPI. The "auto" image was made by simply running the Crop and Straighten Photos tool under Automate and saved. The "proper" image was just manually straightened and cropped. The canvas was not resized and no border was added. As for the size, most of the scans are of 8x10 photos, but the end product does not need to be any specific size. 

 

Basically I'd like the Crop and Straighten Photos tool to 1) Straighten the image, 2) Find the spot it would normally crop, 3) Push those crop lines back 10-20 pixels in all four directions, and then 4) Crop. I figure scripting may be necessary. 

Conrad_C
Community Expert
Community Expert
August 26, 2020

It still seems like you might not understand that since Crop and Straighen Photos can’t do this by itself, we’re suggesting it is possible if you simply combine multiple Photoshop features.

 

I decided to try Melissa’s suggestion because I thought she was on the right track. The action shown below will do what you want for one of the images resulting from Crop and Straighten Photos:

 

 

Here is what it does:

Canvas Size — Choose the Image > Canvas Size command.

With Relative — Use the Relative option so you can enter the difference you want in the canvas size, like 20 pixels. With the Relative option, it doesn’t matter if the originals are different sizes; they will all get the same sized border added to them.

Width and Height — Enter 20 pixels for both, so 20 pixels are added to both Width and Height dimensions.

Horizontal: center and Vertical: center — Add the new pixels from the center, for both dimensions.

Extension Color: background color — The color of the extended canvas will be the current background color, such as white. It would be safer to add another Action step at the beginning that makes sure the background color is set to white.

 

The result of that is 10 extra pixels of white border added around the current image, such as one of the images separated out by Crop and Straighten Photos. The reason it’s 10 pixels is that the 20 pixels is across the entire width or height, so half (10 pixels) gets added on each side. If you wanted 20 pixels added along both dimensions, specify 40 pixels for each dimension.

 

Select Next Document — This step is because Crop and Straighten Photos produces multiple untitled image windows, so you want to run this action on each of the new documents. This last step makes sure that after it finishes adding a white border around one document, it switches to the next document for you.

 

You might also want to add a Save As step between those two, which could set the file format and folder to save them into. But you might have to manually give each new image an appropriate name.

 

The last step you requested is Crop, but it’s not clear why that’s needed. There will be no unneeded extra area to crop. Because you’re working with documents already separated out by Crop and Straighten Photos, each is already cropped down to the image edge with a border added, and nothing outside that.

 

This is where we reach the limits of actions. You do have to manually run this for every new document created by Crop and Straighten Photos, and when you are done you still have to manually name and save all of the new documents, and finally close the original document that had multiple scans on it. This is where scripting could make this better. A script might be able to count how many open documents there are, save each one with your naming convention and then close each, then when there is only one left open (the original scan with multiple images that you no longer need to keep), close it without saving. Unfortunately I’m not good at scripting, but JJMack is extremely good at it.

melissapiccone
Community Expert
Community Expert
August 25, 2020

It is leaving the white border - you mean you want the extra black background in the images?? There is no way to do this with the automated crop and straighten. You could create an action to enlarge the canvas after the fact but you can't do what you are looking for in your propper image except by hand that I'm aware of. 

Melissa Piccone | Adobe Trainer | Online Courses Author | Fine Artist
Chris@LC
Chris@LC작성자
Participant
August 25, 2020

Yeah, the extra black background. I kind of figured that was the case. Hoping maybe someone with scripting knowledge might have developed something.

TheDigitalDog
Inspiring
August 25, 2020

I'm with Melissa, do the crop as desired, then just make an Action to extend the canvas by X number of pixels or percentages etc. Be sure to set the bkgnd color as desired.

Once you have the action, you can then run a batch on a folder of cropped images. 

Author “Color Management for Photographers" & "Photoshop CC Color Management/pluralsight"