Google PageSpeed reported that the JPEG images of a web project I recently worked on should be optimized i.e. compressed. So, I used jpegoptim in batch mode on OS X for the job. You need to build the jpegoptim binary for OS X yourself. Short manual:
- Download jpegoptim sources from developer’s website
- Unpack the TAR ball
- Navigate to the unpacked sources in a shell
chmod a+x configure
./configure
make install
In my case the libjpeg library was missing. I had to download and build libjpeg as part of the official IJG JPEG 8 code. Once everything was in place I simply ran jpegoptim from the command line for all JPEG files in a folder.
jpegoptim -o --dest=./compressed --strip-all *.jpg
This optimizes all .jpg files in the current folder with maximum compression (–strip-all) and saves the compressed files in the ‘compressed’ sub folder (had to be created first).
Hi there – thanks for this tip – I’ve also blogged about it here: http://www.glenn-roberts.com/cleanup-your-photo-library-batch-compress-you
I’ve also added some minor code fixes I put up on GitHub for all to benefit from: http://github.com/glennr/jpegoptim
I just couldn’t bring myself to go back to CVS after 9 years of hell working with that ‘source code control’ system 🙂 Git FTW.
Cheers