New Here ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/td-p/11074302 Apr 23, 2020 Apr 23, 2020
Copy link to clipboard
Copied
I have hundreds of photos that I want to all be square in order to look more clean when presented on a website. These photos have different dimensions, some more square and some more rectangular. I've been creating a new document of the correct square ppi dimensions and have been just importing one photo at a time onto this blank template. Photoshop automatically fits the image perfectly so there is proper white space around the photo just as I need. However like I said there are hundreds of photos. Is there a way to do this in a batch action? I've looked into batch resizing but that seems like it wouldn't help as these photos are all different sizes and I need to add that white square as their background. So it's not so much of a resizing issue, but creating many new documents of the same size all at once and placing all of these photos on the new documents individually. If this isn't possible, that's fine I just was looking for a definite answer as to if I can do this or not because I cannot seem to find an answer online anywhere.
TOPICS
Actions and scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Explore related tutorials & articles
9 Replies 9
Jump to latest reply
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11074348#M324939 Apr 23, 2020 Apr 23, 2020
Copy link to clipboard
Copied
Have a look at the Photoshop Image Processor – File > Scripts > Image Processor
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11076155#M325117 Apr 24, 2020 Apr 24, 2020
Copy link to clipboard
Copied
Image Processor will not change a images aspect ratio to square. The image's aspect ration is preserved. The image is resized via interpolation fit with within the square size you set.
JJMack
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11075240#M325008 Apr 23, 2020 Apr 23, 2020
Copy link to clipboard
Copied
Actions can not handle sizing of document well when they have various document Aspect Ratio and sizes. To size them to a common aspect ratio and size you need to use Photoshop scripting. A script cancrop the images to the outputimageAspect Ratio and resample or set the print resolution of the crop to the output image size soit will have the correct numberof pixels and the correct print resolution.
I wrote two Photoshop Plug-In Script Aspect Ratio Slection "AspectRatioSelection.jsx" andLong Side Print Length "LongSidePrintLength.jsx" Youcan use in action to enable you to create actionthat will do what you want to do. Theyare in my craftingAction Package. The Resolution is changedfor the crop the imageis not resampled via the plug-in after the aspect ration selection crop is made.
Crafting Actions PackageUPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
Contains
- Action Actions Palette Tips.txt
- Action Creation Guidelines.txt
- Action Dealing with Image Size.txt
- Action Enhanced via Scripted Photoshop Functions.txt
- CraftedActions.atn Sample Action set includes an example Watermarking action
- Sample Actions.txt Photoshop CraftedActions set saved as a text file.
- More then a dozen Scripts for use in actions
JJMack
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11075987#M325101 Apr 24, 2020 Apr 24, 2020
Copy link to clipboard
Copied
The following script will resize the canvas to square based on the longest edge, effectively "letterboxing" a landscape image or the opposite on a portrait image. The canvas extension colour is white. You can remove the // comment double slashes from the code to enable resizing, then change the dimensions from 1020,1020 to whatever pixel size you require.
/* https://forums.adobe.com/message/6424562#6424562 */#target photoshop// Save the current ruler units and set to pixelsvar savedRuler = app.preferences.rulerUnits;app.preferences.rulerUnits = Units.PIXELS; var backgroundC = new SolidColor(); backgroundC.rgb.red = 255; backgroundC.rgb.green = 255; backgroundC.rgb.blue = 255; backgroundColor = backgroundC; var doc = app.activeDocument; doc.resizeCanvas(Math.max(doc.width,doc.height),Math.max(doc.width,doc.height))// Uncomment the line below to fit to a 1020px square rather than longest edge//doc.resizeImage(1020,1020) // Restore the ruler unitsapp.preferences.rulerUnits = savedRuler;
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11076169#M325118 Apr 24, 2020 Apr 24, 2020
Copy link to clipboard
Copied
Resize the canvas to the smaller side will crop the image square. Also contentaware fill can fill the added white canvas above. I prefer crop.
JJMack
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11076184#M325120 Apr 24, 2020 Apr 24, 2020
Copy link to clipboard
Copied
Agreed JJMack, for anybody wishing to try this, just change both instances of:
Math.max
to
Math.min
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Kayleah72 AUTHOR
New Here ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11076295#M325129 Apr 24, 2020 Apr 24, 2020
Copy link to clipboard
Copied
Thank you for this! However I'm having trouble finding a way to put this script into Photoshop. I downloaded "Sublime Text" to allow me to save a js file but it says I don't have permission. How do I get this code into Photoshop as the correct file type on a MacBook Pro? I need to do this before I move this file into the Photoshop Scripts folder right?
Thanks in advance!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11076356#M325137 Apr 24, 2020 Apr 24, 2020
Copy link to clipboard
Copied
Any plain text editor will do. Be careful of Apple TextEdit. It has both plain text and rich text modes. BareBones Softwared BBEdit or Atom are also good choices for text editing on the Mac.
More here on scripts:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Downloading JavaScript Files Many legacy ExtendScript-based scripts are offered in .js or .jsx or even .jsxbin formats. Simply downloa...
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Beginner ,
/t5/photoshop-ecosystem-discussions/batch-resizing-photos-of-different-dimensions/m-p/11323466#M351510 Jul 29, 2020 Jul 29, 2020
Copy link to clipboard
Copied
LATEST
This has absolutly saved my life. Thank you so much for this!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more