Imagemagick can resize images.
convert input.jpg -resize 600x600 output.jpg
Note that this will set a maximum size for each side, but will keep the aspect ratio. So a 1200x1000 image resized with the above command will be scaled to 600x500 pixels, while a 1000x1200 image will be resized to 500x600.
You can, of course, put this in a script. On bash, to convert every *.jpg
in a directory to a 600x600 jpg:
for f in ./*.jpg; do convert "$f" -resize 600x600 "${f%.jpg}-resized.jpg"; done
To do the same recursively:
find . -type f -name *.jpg -exec bash -c 'convert "$0" -resize 600x600 "${0%.jpg}-resized.jpg"' {} \;
I don't know how to do those on the Windows command-line/batch script, but I do know it's possible.
If you wish to over-write your original files, you can use ImageMagick's mogrify command:
mogrify input.jpg -resize 600x600
This has the extra advantage of being able to use shell expansion, so you can resize every *.jpg in a directory without resorting to a for loop:
mogrify ./*.jpg -resize 600x600
To use it recursively, you would have to drop it into a find command, as with convert
:
find . -type f -name *.jpg -exec mogrify '{}' -resize 600x600 \;
why not store them on a compressed drive? Would be a lot easier than running a batch conversion. – Keltari – 2013-01-27T18:01:19.070
@Keltari not an option – None – 2013-01-27T18:02:37.217
1+1 for the MSPain typo. Heh, and because this is a good question. – Qqwy – 2013-01-27T23:32:59.240
Possible duplicate of fast batch image resizer, Batch "resize" JPEG images to a fixed file size, and Bulk convert photos to smaller size?.
– Breakthrough – 2013-01-27T23:34:08.477@Breakthrough This is the data for less than 6 months. Its a huge archive.. long story short, I need to make things smaller... – None – 2013-01-27T23:34:43.427