I have a folder full of landscape and portrait oriented photos of a product (2000) and I need to fit all of them in square canvas. I know I could use Photoshop actions to do it in batch, but I do not know what method could I use in order to do it.

So far I run into problems that some pictures have different size, so I cannot simply change the Image Canvas to a specific size, also I do not know how to deal with the fact that some of the pictures have different orientation then others.

How would it be possible to automate this task using Photography editing software? I have Photoshop, Picasa etc.

  • \$\begingroup\$ Never done this but I suspect you are using the wrong tool and may be in the wrong forum. Have you tried collage software (Picasa has that feature)? Otherwise I would like at graphic design & layout software (and ask in the right forum if you do not know those). \$\endgroup\$
    – Itai
    Apr 28, 2012 at 16:02
  • 2
    \$\begingroup\$ Hmmm. Maybe this is me being a bit stupid, but how could you batch change all photos to squares? - surely you need to know where your subject is in the frame? \$\endgroup\$
    – Rob
    Apr 28, 2012 at 17:18
  • \$\begingroup\$ @Rob, not sure how Kristaps want's it done, but I usually shoot as if the frame was square, so each shot is centred for square cropping anyway \$\endgroup\$
    – TFD
    Apr 29, 2012 at 9:46
  • 1
    \$\begingroup\$ @Kristaps: Do you intend to print a "collage", wherin all of the landscape photos are arranged, fit, and printed on a SINGLE canvas? Or do you simply need to resize & crop each landscape photo such that it can fit nicely in a square canvas print? The two are very different things, and it seems people are interpreting your question both ways. Some clarification is needed to really get you the answers you need. \$\endgroup\$
    – jrista
    Apr 29, 2012 at 16:48
  • \$\begingroup\$ @rob, landscape? guess the whole picture is the subject... \$\endgroup\$
    – Roger
    Apr 30, 2012 at 7:20

5 Answers 5


With Photoshop you can use Image Processor Pro (link - scroll half way down page) to process images that will resize your photos to a specific size while maintaining aspect ratio. You could run an action to crop (aka - reduce canvas size) but as @Rob said if you do not know where the subject is how can you batch photos and crop them? You may have to do this manually. I do not know if other programs they will achieve what you are looking for but check out Image Processor Pro as it has several good tools for batching photos.


The excellent free product www.irfanview.com will do this fine

It has a batch mode (B key), and the Advanced options button allows you to crop/resize to any aspect size and ratio, with many options regard how this is calculated etc


If you are willing to use java, here is code I used to make images square. After this you can easily fit those in fixed size square canvas using photoshop.

BufferedImage image = ImageIO.read(IMAGEPATH);
int w = image.getWidth();
int h = image.getHeight();
BufferedImage square= new BufferedImage(Math.max(w,h),Math.max(w,h),BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) combined.getGraphics();
g.drawImage(image, (Math.max(w,h)-w+1)/2, (Math.max(w,h)-h+1)/2, null);
// Save as new image
String fileName=image.getName();
ImageIO.write(combined, "PNG", new File(path, fileName.replace("jpg","png")));

I would separate the landscape and portrait images and create a separate batch file for each group.

All the landscape image horizontal widths would be adjusted to the width needed, then the height would be changed to the same as the width. So if they all need to be 1000px square, then hitting Play should shorten the image width, then the canvas height would be set to 1000px height (adding white space top and bottom).

Then you would batch all the portrait images the same way, but adjusting the image height to 1000px, and the canvas width to 1000px (adding white space left and right).


Here how I do it for my online store

How to prepare picture for magneto: using xnconvert:

  1. batch crop the white space in all the image using the source folder setting
  2. re-size all the images to 500 pixel - or any size depending on the quality of your images - on the longest side
  3. re-size the canvas to 500 x 500 or to the size you've chosen

Done... ;-)


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.