I have nearly 40 thousand of product photos horizontally and vertically. Hence I need a Photoshop action that will spawn them all in the center and make them square. I can't tell Photoshop which is vertical and which is horizontal. So I can't set the canvas size properly.

Do you know of a script for this?

  • This is very similar to this question. But in that, the OP wants the image to fit inside a square. I assume you want to fill the square. I'll write an answer.
    – Wolff
    Commented Oct 29, 2021 at 15:36
  • If you're on a Mac, I would recommend lemkesoft.de/produkte/graphicconverter for this. It has a batch function that is far easier to use than PS.
    – AAGD
    Commented Oct 29, 2021 at 16:35

1 Answer 1


Here is a recipe for an action that will crop an image with any aspect ratio into a square. It will make the image fill a square so the excess will get cropped away.

Create a new action and record the following:

  • Press Ctrl /Cmd + A to select all.

  • Perform Select > Transform Selection, rotate the selection 90 degrees and press Enter to commit the transformation.

  • Perform Image > Crop to crop the image to the selection.

Use this action to batch all your images.

Be aware that using this method you might crop away parts of the image in an unaesthetic way.

  • use-case is is probably an e-commerce thing where the initial thumbnails are square by default. So in the rotation step, the temp layer content now has transparent letterboxing to allow for the ctrl+click selection?
    – Yorik
    Commented Oct 29, 2021 at 18:27
  • @Yorik, yes after rotation the template layer has the same width as the height of the document or vice versa. The selection will be confined to the document bounds so it becomes a square.
    – Wolff
    Commented Oct 29, 2021 at 18:40
  • @Yorik, btw I simplified the method. Don't know why I felt the need to add all those unnecessary steps.
    – Wolff
    Commented Oct 29, 2021 at 18:54
  • I think your reduction leaves an image sideways?
    – Yorik
    Commented Oct 29, 2021 at 18:57
  • @Yorik, try it out. You are not rotating the image, only the selection itself.
    – Wolff
    Commented Oct 29, 2021 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.