Answer the question
In order to leave comments, you need to log in
How to make square images in bulk using Photoshop?
Hello.
It is necessary to make a square image out of a rectangular image, by enlarging it with a white background, and not cropping it.
This script fits.
var savedRuler= app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var w = app.activeDocument.width;
var h = app.activeDocument.height;
if(w>h) app.activeDocument.resizeCanvas (w, w, AnchorPosition.MIDDLECENTER);
if(w<h) app.activeDocument.resizeCanvas (h, h, AnchorPosition.MIDDLECENTER);
//if w==h already square
app.preferences.rulerUnits = savedRuler;
Answer the question
In order to leave comments, you need to log in
There is such a thing as batch processing photos through a Photoshop droplet. Google it as one of the options.
Solving the problem:
1. Create a script in a text file (copy the code into it):
var savedRuler= app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var w = app.activeDocument.width;
var h = app.activeDocument.height;
if(w>h) app.activeDocument.resizeCanvas (w, w, AnchorPosition.MIDDLECENTER);
if(w<h) app.activeDocument.resizeCanvas (h, h, AnchorPosition.MIDDLECENTER);
//if w==h already square
app.preferences.rulerUnits = savedRuler;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question