Monthly Archives: April 2014
Mac OS X , shell script/GUI tool for batch image resize.

A friend of mine asked if it was possible.
the following script takes two inputs

1.master image file.

test.jpg <-or whatever your master image is.

2.a text file with the sizes listed in pairs:

<height in pixels> <width in pixel>

—Sample sizes.txt
120 120
130 130
400 400

Make sure that there is an empty line a the end of the file , only 1. more will give unwanted I said error handling
will be done when I get to it.


usage: put the script and master image in a folder and run the script from the command.

$ ./
Enter the master image file name:
What is the filename with the sizes?:
Changing test.jpg based on sizes.txt
[the script will output the transforms]

notes:absolute no error handling yet. will do once I get around to it.

works on Mac os X and should work on other linux systems.

——————–actual source——————

#this will resize images
echo “Enter the master image file name:”
read masterfile
echo “What is the filename with the sizes?:”
read sizefile
echo “Changing $masterfile based on $sizefile”
while read line
echo “$line ”
echo “$destfile”
cp $masterfile $destfile
sips -z $line $destfile
done < “$sizefile”


Shell script with sample size file:
Download here.


Simple GUI based version:
–double click icon. (duhhh) master image text file with sizes. destination folder.

Download here.


iOS icon generating size file :
usage:use with tools above.

Download here.

Posted on 2014年4月28日, 10:09 PM By
Categories: stuff