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 \;