Wonders never cease.
Thanks to Cory at maclife, just discovered that OSX Terminal has a built in image resizing tool, SIPS.
You can read the official manual entry for SIPS to see the full power. But here’s some simple examples that I was using an image resizing tool for.
(1) resize all JPGs in current folder to fit in a box 800×800
sips *.jpg -Z 800
This will automatically find the largest dimension (width or height), resize that to be 800 and adjust the other to keep the same aspect ratio. Noice.
(2) resize all PNGs in current folder to 100 wide (keep aspect ratio)
sips *.png --resampleWidth 100
You can guess what the command is to set the height instead of width.
Works really well, and really fast. But beware of a couple of limitations.
- edits the original file directly. If worried take copies beforehand.
- doesn’t support changing the filename. If needed you’ll need to do that step separately before/after.