
The reason I rotate the aspect ratio to match the document's orientations is the Cropping a landscape to portrait aspect ratio and cropping a portrait to a landscape composition wise does not work. You would need an Absolute aspect ratio selection plug-in script. However my will rotate the aspect ratio to match the document's orientation. I created an Aspect ratio selection plug-in script based on Adobe Fit images script.
Photoshop image resize and rename script pro#
You may be able to combine that script into actions that do the aspect ratio crops then have Image processor pro do the resizes and save. Enter Batch Edit Did you know you can resize, edit, rename, watermark and organize an entire set of photos (tens hundreds tons) with just one click Okay, so maybe one click is a little exaggerative, but just check this out below. If you want to crop and resized your images you would need a different script.

Then X's Image Processor Pro plug-in script will do what you want. If you want to retain you images aspect ratios and be resized to fit within the the sizes you listed. Do you want your images fitted the the sizes you listed or do you wnat you images to be center cropped to the different aspect ratios and sized to the listed images sizes. You lasted not only different Images sizes you listed different aspect ratios. More then a dozen Scripts for use in actions.Sample Actions.txt Photoshop CraftedActions set saved as a text file.CraftedActions.atn Sample Action set includes an example Watermarking action.Action Enhanced via Scripted Photoshop Functions.txt.The Aspect Ratio Selection Plug-in is in my crafting actions package.Ĭrafting Actions Package UPDATED Added Conditional Action steps to Action Palette Tips. Mixing in Portrait source images would not work on the portrait images correctly. In the Script drop-down select OpenAsLayerNoExtension.jsx.

For Photoshop Event: use the drop-down to select Open Document.

Copy the script into the Adobe Photoshop 2022 folder / Presets / Scripts / Event Scripts Only. These three actions would then be used with image processor Pro the action would crop to the correct aspect ratio IPP would the resize them to fit your sizes. This script will have no effect on documents that do not have a background layer. The other two actions would record the other aspect ratios. Step 1 menu File.Automate>Aspect Ratio Selection In the dialog set the aspect ratio, centered, rectangle, replace, selection, feather 0, OK You could record actions that use my Aspect Ratio selections to make center crops of your images then have Image processor pro do the rest thar is resize and save. Fit it: In the Fit To drop-down menu, choose from several popular web and print sizes or use the Width and Height numbers to precisely resize in pixels, inches, or other measurements. Resize to 276x385 and rename to FILENAME_XS.jpg So when your script Place in an image if resize during place scaled the smart object to fit on canvas after you place the image you can do a resize layer to 100 the layer size will be the size that Place scale the image file to. Open it: Select the image you want to resize, then go to the main menu bar and select Image Image Size to open the Image Size dialog box. Resize to 374x498 and rename to FILENAME_SM.jpg Resize to 500x500 and rename to FILENAME_MD.jpg Var options = new ExportOptionsSaveForWeb() ĭoc.exportDocument(File(doc.path+'/'+newName),ExportType.If all your images and sizes all have the same orientation like your examples are all landscape they are wider than they are tall Convert the canvas size as informed above for the END RESULTĪpp.activeDocument.resizeCanvas(UnitValue(fWidth,"px"),UnitValue(fHeight,"px"))
Photoshop image resize and rename script code#
otherwise, resize based on widthĭoc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BICUBIC) ĭoc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BICUBIC) Here's the code for your first script - copy and paste this into the main code window on the left: currentdocument app.activeDocument newwidth 670 currentdocument.resizeImage ( UnitValue (newwidth, 'px' ), null, null, ResampleMethod.BICUBIC ) Let's break down what this code is doing. if height > width (portrait-mode) resize based on height. these are our values for the END RESULT width and height (in pixels) of our image Important for resizing GIFs with indexed colors, to get better results get a reference to the current (active) document and store it in a variable named "doc" Then, make an ACTION if want to use it with many files. jsx file in your Photoshop \Presets\Scripts folder.

Resize, crop, change color depth, apply color effects, add text, watermark and border effects. So, I gathered a few and solved the problem myself. Support JPEG, BMP, GIF, PNG, TIFF and JPEG2000. Searching the web I've found many potential solutions but 100% of them converted to square sizes.
