batch resize

PZ
Posted By
Pat Ziegler
Jul 15, 2007
Views
993
Replies
16
Status
Closed
I have a large volume of .jpg files that I need to resize to 180pxls X 180pxls. The images are not all of the same proportion so, they need to be squared up and then resized. Some are slightly vertical and some are slightly horizontal.

My idea is to make an action that will stop for user input at the image size dialog. How can I get the action to stop here.

Any other suggestions that offer a different approach are welcome.

Thanks

PZ

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

C
catfish
Jul 15, 2007
Depends how much "off square" they are – five, maybe ten pixels off – like 172 x 183 and convert to 180 x 180?

If you can live with a bit of distortion caused by forcing square, and assuming these are thumbnails and a bit of distortion is ok, have you thought about irfanview? www.irfanview.com

It is free and has a batch process capability that will resize to any size. I’m assuming these are jpg files, although irfanview can convert from/to a wide variety of formats. I’m also assuming a windows environment.

"DBLEXPOSURE" wrote:
I have a large volume of .jpg files that I need to resize to 180pxls X 180pxls. The images are not all of the same proportion so, they need to be squared up and then resized. Some are slightly vertical and some are slightly horizontal.

My idea is to make an action that will stop for user input at the image size dialog. How can I get the action to stop here.

Any other suggestions that offer a different approach are welcome.
Thanks

PZ
N
nomail
Jul 15, 2007
DBLEXPOSURE wrote:

I have a large volume of .jpg files that I need to resize to 180pxls X 180pxls. The images are not all of the same proportion so, they need to be squared up and then resized. Some are slightly vertical and some are slightly horizontal.

My idea is to make an action that will stop for user input at the image size dialog. How can I get the action to stop here.

Record it and when finished click on the square in front of the image size step. You will see a red menu icon appear, indicating that the action will stop for user input.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.com
E
edjh
Jul 15, 2007
DBLEXPOSURE wrote:
I have a large volume of .jpg files that I need to resize to 180pxls X 180pxls. The images are not all of the same proportion so, they need to be squared up and then resized. Some are slightly vertical and some are slightly horizontal.

My idea is to make an action that will stop for user input at the image size dialog. How can I get the action to stop here.

Any other suggestions that offer a different approach are welcome.
Thanks

PZ
You don’t need to go through all that. Look at File>Automate>Fit Image. It can be used in an action.


Comic book sketches and artwork:
http://www.sover.net/~hannigan/edjh.html
Comics art for sale:
http://www.sover.net/~hannigan/batsale.html
PZ
Pat Ziegler
Jul 16, 2007
You don’t need to go through all that. Look at File>Automate>Fit Image. It can be used in an action.

Nice try but Fit Image will not square the image. I would still have to then expand the canvas in one direction or the other. I would still need the action to stop and allow for user input.

Surely there is way to make an action stop and allow user input?

PZ
N
nomail
Jul 16, 2007
DBLEXPOSURE wrote:

You don’t need to go through all that. Look at File>Automate>Fit Image. It can be used in an action.

Nice try but Fit Image will not square the image. I would still have to then expand the canvas in one direction or the other. I would still need the action to stop and allow for user input.

Surely there is way to make an action stop and allow user input?

Yes, and I already answered that. Click on the square in front of the step you want to stop for user input. A red menu-icon appears to show you’ve done so.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.com
E
edjh
Jul 16, 2007
DBLEXPOSURE wrote:
You don’t need to go through all that. Look at File>Automate>Fit Image. It can be used in an action.

Nice try but Fit Image will not square the image. I would still have to then expand the canvas in one direction or the other. I would still need the action to stop and allow for user input.

Surely there is way to make an action stop and allow user input?
PZ
Fit Image will resize the image to fit an imaginary box of the desired dimensions without distorting it, so yes, it should do what you want with no interruptions.

You can insert Stops but that defeats the purpose of Batching, IMHO.


Comic book sketches and artwork:
http://www.sover.net/~hannigan/edjh.html
Comics art for sale:
http://www.sover.net/~hannigan/batsale.html
N
nomail
Jul 16, 2007
edjh wrote:

You don’t need to go through all that. Look at File>Automate>Fit Image. It can be used in an action.
Nice try but Fit Image will not square the image. I would still have to then expand the canvas in one direction or the other. I would still need the action to stop and allow for user input.

Surely there is way to make an action stop and allow user input?
Fit Image will resize the image to fit an imaginary box of the desired dimensions without distorting it, so yes, it should do what you want with no interruptions.

No, it won’t. Fit Image will keep the aspect ratio as it was, so if the image isn’t square, Fit Image will not make it square. The OP wants the images to become square, so Fit Image won’t work.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.com
PZ
Pat Ziegler
Jul 16, 2007
Fit Image will resize the image to fit an imaginary box of the desired dimensions without distorting it, so yes, it should do what you want with no interruptions.

You can insert Stops but that defeats the purpose of Batching, IMHO.

Yes, it does resize the image to fit within a certain sized box but does not put the image in that box. In the end, I need the image to be square, 180 x 180.

I could do a "Fit Image" batch but I would then still need to adjust canvas size on every individuel image.
N
nomail
Jul 16, 2007
DBLEXPOSURE wrote:

Yes, it does resize the image to fit within a certain sized box but does not put the image in that box. In the end, I need the image to be square, 180 x 180.

I could do a "Fit Image" batch but I would then still need to adjust canvas size on every individuel image.

Actually, you can’t use ‘Fit Image’ at all, because that will make the LONGEST side 180 pixels. Changing the Canvas Size is easy and can also be done in an action (just set the canvas size to 180 x 180 pixels), but there is no simple way to make the SHORTEST side 180 pixels and that is what you would need to do.

The only way would be to know what is the maximum difference between a square and what you have now. Say that the maximum is 2:3 aspect ratio. That means that if you use Fit Image at 270 x 270 pixels, all your images will be AT LEAST 180 pixels at the shortest side. Then, as the next step, you can use Canvas Size to crop them all at 180 x 180 pixels. It does mean that the images are going to be cropped, and some are going to be cropped more than needed. But if you can live with that, this seems to be the only option that does not involve any user input.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.com
P
Paul
Jul 16, 2007
The way I would do this is:-
Open a file
Create an action,
Select the CROP tool
Set it to 180px by 180px and the resolution you want
move that selection/resize on screen and double click
save the result using saveas.
stop the recording.

Now this is the neat part of it!
Expand the listing of the newly created action and along side the CROP section put in a tick

Now when you batch this action it will always allow you to resize/move the crop section and when you complete with double click it will then save that file and open the next.

Paul.
E
edjh
Jul 16, 2007
Johan W. Elzenga wrote:
edjh wrote:

You don’t need to go through all that. Look at File>Automate>Fit Image. It can be used in an action.
Nice try but Fit Image will not square the image. I would still have to then expand the canvas in one direction or the other. I would still need the action to stop and allow for user input.

Surely there is way to make an action stop and allow user input?
Fit Image will resize the image to fit an imaginary box of the desired dimensions without distorting it, so yes, it should do what you want with no interruptions.

No, it won’t. Fit Image will keep the aspect ratio as it was, so if the image isn’t square, Fit Image will not make it square. The OP wants the images to become square, so Fit Image won’t work.
Okay, I misunderstood. Not sure I can see why someone would want images distorted.


Comic book sketches and artwork:
http://www.sover.net/~hannigan/edjh.html
Comics art for sale:
http://www.sover.net/~hannigan/batsale.html
PZ
Pat Ziegler
Jul 17, 2007
"Paul" wrote in message
The way I would do this is:-
Open a file
Create an action,
Select the CROP tool
Set it to 180px by 180px and the resolution you want
move that selection/resize on screen and double click
save the result using saveas.
stop the recording.

Now this is the neat part of it!
Expand the listing of the newly created action and along side the CROP section put in a tick

Now when you batch this action it will always allow you to resize/move the crop section and when you complete with double click it will then save that file and open the next.

Paul.

No cropping. Square it up. size it down.
PZ
Pat Ziegler
Jul 17, 2007
"edjh" wrote in message
Johan W. Elzenga wrote:
edjh wrote:

You don’t need to go through all that. Look at File>Automate>Fit Image. It
can be used in an action.
Nice try but Fit Image will not square the image. I would still have to
then expand the canvas in one direction or the other. I would still need
the action to stop and allow for user input.

Surely there is way to make an action stop and allow user input?
Fit Image will resize the image to fit an imaginary box of the desired dimensions without distorting it, so yes, it should do what you want with no interruptions.

No, it won’t. Fit Image will keep the aspect ratio as it was, so if the image isn’t square, Fit Image will not make it square. The OP wants the images to become square, so Fit Image won’t work.
Okay, I misunderstood. Not sure I can see why someone would want images distorted.

Not distorted.

got it done. Used an action that did a "Fit Image" to 180pxls and then opened the Canvas size dialog and waited for user input. This let me lengthen the short side to 180pxls.

Result is 180X180 with no cropping or distorted images.

600 files took a couple hours.

Thanks
N
nomail
Jul 17, 2007
DBLEXPOSURE wrote:

Okay, I misunderstood. Not sure I can see why someone would want images distorted.

Not distorted.

got it done. Used an action that did a "Fit Image" to 180pxls and then opened the Canvas size dialog and waited for user input. This let me lengthen the short side to 180pxls.

Result is 180X180 with no cropping or distorted images.

600 files took a couple hours.

You could have done it in 15 minutes. I thought you wanted to crop the images, now I understand you don’t mind to have white borders. If that is so, there was no reason for user input at all. You could have simply used and action with two steps: First Fit Image to 180 x 180 pixels, then Canvas Size at 180 x 180 pixels without user input.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.com
H
Hank
Jul 18, 2007
DBLEXPOSURE wrote:
"Paul" wrote in message
The way I would do this is:-
Open a file
Create an action,
Select the CROP tool
Set it to 180px by 180px and the resolution you want
move that selection/resize on screen and double click
save the result using saveas.
stop the recording.

Now this is the neat part of it!
Expand the listing of the newly created action and along side the CROP section put in a tick

Now when you batch this action it will always allow you to resize/move the crop section and when you complete with double click it will then save that file and open the next.

Paul.

No cropping. Square it up. size it down.
I’m reading this thread and not quite getting it; exactly HOW did the OP successfully get an image of, say, 140 x 180 pixels to become 180 x 180 without adding blank canvas, cropping, or distortion?? This seems to violate the laws of physics…
PZ
Pat Ziegler
Jul 18, 2007
I’m reading this thread and not quite getting it; exactly HOW did the OP successfully get an image of, say, 140 x 180 pixels to become 180 x 180 without adding blank canvas, cropping, or distortion?? This seems to violate the laws of physics…

Hank,

Something must have been lot in translation.

I started with images that where not square, say 300X450. None where necessarily the same ratio or size, and there where about 600 of them. I needed to make them all 180 x 180 for a Web application.

Somebody suggested, use Fit Image. Which was okay but still left me with images that where not square.

So, I need to change the canvas size on the short dimension to 180pxls.

Since there where so many images and I didn’t want to spend all week on this project, I was looking to run a batch on all the images, ideally with no user intervention.

I never did find a way to do that. The best I came up with was an action that did the "Fit Image" to 180×180 which left me with images that would fit a 180sqr box but not square.

Too fix this I inserted a change-canvas-size "Menu item" into the action that would stop and let me enter the appropriate number into the dialog to lengthen the short side of the image.

Took two hours or so to finish all 600.

Changing canvas size was allways an option.

PZ

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections