Photoshop resize script assitance

Associate
Joined
15 Nov 2002
Posts
829
Location
Colchester
I have about 500~1000 images I need to resize from various source folders and in both portrait and landscape. For small jobs I automate this by recording a script that opens the save for web console and sets the maximum size of the x or y axis depending on whether it is portrait or landscape to 800 pixels and to maintain the aspect ratio. I then select a batch of images from my folder in ladscape or portrait and applythe relevant script.
The main problem with this approach is that I have to recreate the script every time I have a new batch of photos since the target folder to dump the resized images into needs to change for each source folder. Also I dont know how to auto detect the format of the image.

Does anyone have a solution to this problem that would ideally autodetect whether the image is portrait or landscape and resize appropriately, and that would intelligently place the final resized images into a new folder inside the source folder?

Any help appreciated

Stuart
 
How can the computer know if the image is portrait or landscape? The only way I can think of is if the info is embedded in the EXIF?

Unless you classify any image as being wider than taller, is a landscape image?

Personally I would code a small script and use Imagemagick to do the deed. Would take about 10 minutes.
 
How can the computer know if the image is portrait or landscape? The only way I can think of is if the info is embedded in the EXIF?

Unless you classify any image as being wider than taller, is a landscape image?

Personally I would code a small script and use Imagemagick to do the deed. Would take about 10 minutes.


Easy really when you think about it, whichever axis X or Y is the longer then that determines whether it is landscae or portrait. I manually resize based on the longest measurement to 800 pixels and keep the aspect ratio the same and just need something to do that calculation in PS automatically as well as having the script put the new images in a child folder of its parent labelled processed or something similar

How good is Imagemagick with the resized quality? I am happy with the Photoshop resize for web quality but have not had great success with others
 
Easy really when you think about it, whichever axis X or Y is the longer then that determines whether it is landscae or portrait. I manually resize based on the longest measurement to 800 pixels and keep the aspect ratio the same and just need something to do that calculation in PS automatically as well as having the script put the new images in a child folder of its parent labelled processed or something similar

How good is Imagemagick with the resized quality? I am happy with the Photoshop resize for web quality but have not had great success with others

So the images are already rotated. Ok.

tried imagemagick yet? if not install it (try the q8 dll version) and the copy paste this into a text file called resize.bat

Code:
@echo off
rem needs imagemagick..
SET resize=800
SET src=%~1
set processed=%src%\_processed
set fileOut=png

IF NOT EXIST "%processed%" MKDIR "%processed%"
FOR /F "delims=" %%A IN ('dir %1 /b /a-d') DO (
	echo Resizing.. %%A
	convert "%src%\%%A" -resize %resize%x%resize% "%processed%\%%A_%resize%.%fileOut%"
)

goto:eof

Then drag and drop a folder of images onto this to convert them to 800 max. it will create a new copy of the image resized.


As for the quality, well you'll need to read these:
http://www.imagemagick.org/Usage/resize/
http://www.xs4all.nl/~bvdwolf/main/foto/down_sample/example1.htm
http://www.xs4all.nl/~bvdwolf/main/foto/down_sample/down_sample.htm
 
Brilliant! Thanks whitecrook :)

This is exactly what I was after and although it takes the workflow out of PS I think its worth it. I will do some IQ comparrisons myself but it looks like this will be in use for the forseeable future.
 
Back
Top Bottom