batch resive for different dimentions

JW
Posted By
jam_wood
Oct 10, 2008
Views
336
Replies
9
Status
Closed
I have a selection of photos. They are different resolutions and some are landscape and some portrait.

I want to record an action so that all the images become square, but the original pixels arnt stretched. If I was doing this manually I would;

Copy the image.
Resize it to square.
Erase the image
Paste the original image back so it wasnt stretched, was centered, and the background was white.

I would know how to record an action if all the images were the same dimensions but is it possible to record one that will work the variety of my images dimensions?
thanks

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

JS
Jeff_Schewe
Oct 11, 2008
You would need to record a Fit Image (from the Automate menu) and set the max dimensions you want…afterwich you would add the sept to make the canvas a fixed size square with the background color you want. That would make both orientations end up on squares…
JW
jam_wood
Oct 13, 2008
What does Fit Image in the Automate menu do?
JW
jam_wood
Oct 13, 2008
Does anyone have a link to a tutorial/ other web resource on this? thanks
PR
Paul_R
Oct 13, 2008
A simple script should do the job.

#target photoshop

var strtRulerUnits = app.preferences.rulerUnits;

var strtTypeUnits = app.preferences.typeUnits;

app.preferences.rulerUnits = Units.PIXELS;

app.preferences.typeUnits = TypeUnits.PIXELS;

var White = new SolidColor;

White.rgb.hexValue = ‘ffffff’;

backgroundColor = White;

if(activeDocument.width.value > activeDocument.height.value){

app.activeDocument.resizeCanvas(activeDocument.width.value, activeDocument.width.value, AnchorPosition.MIDDLECENTER);

}else{

app.activeDocument.resizeCanvas(activeDocument.height.value, activeDocument.height.value, AnchorPosition.MIDDLECENTER);

}

app.preferences.rulerUnits = strtRulerUnits;

app.preferences.typeUnits = strtTypeUnits;
JW
jam_wood
Oct 13, 2008
I dont know anything about scripts!

Is there a way of doing the same thing with the menu so I understand what im doing? I know a long winded manual way of doing this but i want something i can record as an action.

If not, how to I run that script?
thanks for you help
PR
Paul_R
Oct 13, 2008
To run a script..
Save the script usin ExtendScript Toolkit (This is the script editor that comes with Phototoshop and save it ..
PC:- C:/Program Files/Adobe/Adobe Photoshop CS#/Presets/Scripts/ Mac:- [hard drive]/Applications/Adobe Photoshop CS#/Presets/Scripts/

To run the script File – Scripts – and select your script.

You can also record an action of calling the script this could then be used in batch. The beauty of using a script is that it can tell the difference between portrait/landscape etc.
JW
jam_wood
Oct 13, 2008
thanks a lot
JW
jam_wood
Oct 13, 2008
In case anyone is watching this post ive managed to fix the problem by going Image/ Canvas Size.

Might not be as flexible as script but will do for me!
thanks paul
R
Ram
Oct 13, 2008
Jam,

In case anyone is watching this post ive managed to fix the problem by going Image/ Canvas Size.

That’s precisely what Jeff suggested in post #1. :/

Whats a sept?

Typo for step. 😀

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Related Discussion Topics

Nice and short text about related topics in discussion sections