Skip to main content
hello8989
Participant
February 10, 2021
Answered

How to crop batch multiple images?

  • February 10, 2021
  • 4 replies
  • 38165 views

I have a bunch of images that I want to trim. How to crop/ trim batch multiple images?

 

Thank you!

Correct answer Stephen Marsh

Image > Trim, based off transparency, upper left or lower right pixel colour?

4 replies

C0FF33_ZA
Participating Frequently
August 15, 2025

Provided all files are set up the same way (if not, batch save out as png first);
Set up an action that performs a CTRL+Left Click on the layer,
Then ALT+i
Then P to crop flush.
Then CTRL+SHIFT+ALT+S to save for web as a png.
Test it on a control group, once confirmed as working, batch run this action on your folder.

If you have glow effects and such, there may be empty space that seems useless, but it still contains a pixel somewhere at the outermost edge.

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
February 10, 2021

Image > Trim, based off transparency, upper left or lower right pixel colour?

Participant
August 29, 2023

I created an action for trimming images with transparent backgrounds but when I run Batch for multiple files, Photoshop asks me every single time anyway whether I want the trimming to be based  on transparent pixels or whatever color in the corners. How can I skip on this dialogue and sort of set it to transparency by default so I can leave the computer and just let it run?

Stephen Marsh
Community Expert
Community Expert
August 30, 2023

Ah sorry I misunderstood 🙂 Yeah the pictures are not flattened but may have multiple layers inside. The whole procedure is basically

* trim transparency

* Select all layers

* set transparency on all layers to 0%

* merge all layers to one

 

Here is my action:

 

Any ideas?


@kaig11620057 – I setup an action the same as yours and ran it via batch, the trim step didn't pop up any dialog with non-flattened files.

 

I can't test this script as I can't reproduce your issue, but you could always try replacing the Trim step in your action with a script:

 

#target photoshop
var savedDisplayDialogs = app.displayDialogs;
app.displayDialogs = DialogModes.NO;
try {
    activeDocument.trim(TrimType.TRANSPARENT);
} catch (e) {}
app.displayDialogs = savedDisplayDialogs;

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html 

Jon-M-Spear
Legend
February 10, 2021

Photoshop has a facility to record a set of repetitive actions which you can run in the future.

 

Canvas Size is a means to change the canvas size (not to be confused with resampling the image).  So if you had a canvas of (say) 200px x 200px.  If you set canvas size to 180px x 180px, you would reduce the canvas size by 10px on each side. (crop).

 

What do you mean by 'blank page'?  Why have images got blank page?   

Jon-M-Spear
Legend
February 10, 2021

Do they all need exactly the same amount of crop and same positioning of crop?

 

If so, create a 'canvas size' action.  Then go to File > Automate > Batch.  Select your images and apply your Canvas Size action.

 

If each image needs a unique input, I can't think of a way to batch that.

hello8989
hello8989Author
Participant
February 10, 2021

Thank you, but what is 'canvas size' action?

hello8989
hello8989Author
Participant
February 10, 2021

I just want to trim the 'blank page' around my images.