This only works if you have access to a linux box or have the convert program installed on your computer.
I had 20 images of size 350×350, I needed to resize them, and grab the middle portion of each image. I could use gimp and spend an hour of mind numbing boredom to do this or I could write a little script to do it.Here is the script. (Remember this is for Linux not windows)
for i in `ls *.png`; do echo $i; convert -size 98×98 $i -resize 98×98 -crop 74×74+12+12 +repage +profile ‘*’ small/$i ; done
- lists all the png files in the current directory
- it first resize all the pictures to 98px by 98px
- it then crops these 74px by 74px, cutting out the middle 74×74 (74+24=98)
- it repages the canvas so the 74×74 starts at1:1, not 12:12
- it cleans out all profile information
- and put the file in a sub directory of small, current to where you are.
Just had a situation to day, [Nov 9th 2012], where I needed flags for all countries of the world. From here, http://www.nordicfactory.com/creative/illustrations/download-free-flag-set-in-png/, I found just what I wanted, except they where 256×256, a bit to big for today’s project. So to over come this quickly, I did not what to go though 230 odd files and resize them down to 64×64, I used this script.
- First changed dir to the flags dir.
- Made a new dir called sm64
- Ran this script
- for i in `ls *.png`; do echo $i; convert -size 64×64 $i -resize 64×64 +repage +profile ‘*’ sm64/$i ; done