Highlighted

How can I automate a batch crop and straighten function on single pics?

New Here ,
Dec 22, 2008

Copy link to clipboard

Copied

Here's my problem. I have to shoot thousands of pics of baseball cards. The cards are of varying sizes but they're rectangular in shape. I need to crop out the background (black velvet) and maybe straighten the images (depending on how close I can get the images straight when I shoot them)

PS has a nice command that will automatically crop and straighten pics that have been scanned. I've tried to run this command on my single pics and it works fine, except that I also get two additional crops/pics of stray hairs on the black background. I've also tried to make an action that I can turn into a batch or droplet and run on all the pics. I've not had much success. I'll end up with pics of stray hairs and not the card. I then have to go and manually delete the stray pics. Too much work.

Is there any way I can automate the process of cropping, straightening the pics then saving then new version?

Thanks

Topics

Actions and scripting

Views

38.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How can I automate a batch crop and straighten function on single pics?

New Here ,
Dec 22, 2008

Copy link to clipboard

Copied

Here's my problem. I have to shoot thousands of pics of baseball cards. The cards are of varying sizes but they're rectangular in shape. I need to crop out the background (black velvet) and maybe straighten the images (depending on how close I can get the images straight when I shoot them)

PS has a nice command that will automatically crop and straighten pics that have been scanned. I've tried to run this command on my single pics and it works fine, except that I also get two additional crops/pics of stray hairs on the black background. I've also tried to make an action that I can turn into a batch or droplet and run on all the pics. I've not had much success. I'll end up with pics of stray hairs and not the card. I then have to go and manually delete the stray pics. Too much work.

Is there any way I can automate the process of cropping, straightening the pics then saving then new version?

Thanks

Topics

Actions and scripting

Views

38.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Valorous Hero ,
Dec 23, 2008

Copy link to clipboard

Copied

Have a look here..
http://www.adobeforums.com/webx/.59b7368d/5

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
May 27, 2011

Copy link to clipboard

Copied

Hi Paul, looking for the article from the link you posted (http://www.adobeforums.com/webx/.59b7368d/5)

but it takes me to the forum home page (http://forums.adobe.com/index.jspa)

Could you give me some keywords or the topic so I can find it?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Valorous Hero ,
May 28, 2011

Copy link to clipboard

Copied

I think this was the script....

#target Photoshop
app.bringToFront;
var inFolder = Folder.selectDialog("Please select folder to process");
if(inFolder != null){
var fileList = inFolder.getFiles(/\.(jpg|tif|psd|)$/i);
var outfolder = new Folder(decodeURI(inFolder) + "/Edited");
if (outfolder.exists == false) outfolder.create();
for(var a = 0 ;a < fileList.length; a++){
if(fileList instanceof File){
var doc= open(fileList
);
doc.flatten();
var docname = fileList
.name.slice(0,-4);
CropStraighten();
doc.close(SaveOptions.DONOTSAVECHANGES);
var count = 1;
while(app....
























Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
May 28, 2011

Copy link to clipboard

Copied

I do not know why this append is here in an old thread on batch crop and straightening images for baseball cards. If this append has anything to do with something like a composit thing a baseball card, mag cover etc. An other way to address the problem is to batch populate a Photo Collage Template that will auto size and place in images into a template and leave the populated collage as a PSD file so that it can be tweaked. ie Straighten image add anotation change position etc. My Photoshop Photo Collage Toolkit is designed to do just that. In fact is comes with a sample Baseball Template and Mag Cover template.  The sample Basball Template has many groups and  hidden layers that let you change things like Logos, Frame, Field position etc. Example:

http://www.mouseprints.net/old/dpr/Babe%20Ruth%20Card.jpg

and

http://www.mouseprints.net/old/dpr/JJMackTime.jpg

Documentation amd download http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.htmlany

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Sep 05, 2011

Copy link to clipboard

Copied

Thank you, thank you, thank you.

You just saved me about 90 minutes worth of work by reposting this script.  I followed your directions and I'm now watching Photoshop fly through a batch crop and straighten process for about 60 "gang scanned" images.

I really appreciate the help.

Cheers,

AJ

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Dec 23, 2008

Copy link to clipboard

Copied

Thanks Paul, I appreciate the help but two issues with that. The instructions are for someone who has scanned multiple images and wants to separate them. I have one image that I need to separate from the background.

The second issue is what the heck do I do with the code? I'm not a programmer or even a good PS user so the code is meaningless to me. Do I copy and paste it somewhere??

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Valorous Hero ,
Dec 23, 2008

Copy link to clipboard

Copied

The code will work if there are multiple images or just one.
All it means is that it will automate doing a folder of documents.
All the new extracted documents are save in a folder called "Edited" off the selected folder.

Photoshop JavaScripts are saved useing a text editor or better still Photoshop editing environment "Adobe ExtendScript Toolkit" this get installed at the same time as Photoshop. Copy the code and paste it into a new "ExtendScript Toolkit" document the save it to the relevant folder.
PS7 and PSCS are saved with an "js" extension and PS2/3/4 are saved with a "jsx" extension.
The normal place to save the scripts is:
PC:- C:/Program Files/Adobe/Adobe Photoshop CS#/Presets/Scripts/
Mac:- [hard drive]/Applications/Adobe Photoshop CS#/Presets/Scripts/
Allthough they can be saved anywhere you like.
To run a script:
File - Scripts (select script) (if placed in above folders) or
File - Scripts - Browse (to where ever you saved the script.)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Dec 23, 2008

Copy link to clipboard

Copied

Thanks Paul, sorry to be such a noob at this but I can't find the "ExtendScript Toolkit" document needed to create the document. I have a folder called "Scripting guide" that contains sample scripts and a Utility folder which contains a "ScriptingListener" plugin but that's it. I'm still struggling with this.

I really appreciate your help.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Valorous Hero ,
Dec 23, 2008

Copy link to clipboard

Copied

You would normally find it here:-
C:\Program Files\Adobe\Adobe Utilities
CS3 and CS4 there should be shortcuts existing under Start - Programs

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...