For many, many moons I have continually been using ImageOptim to optimize all the images in my layout. This works well but unfortunately, the one drawback is that you cannot use it when images need to be uploaded from a backend system (i.e. Photo Gallery, Avatars, etc).
Squish is primarily for command line use only. It handles two types of optimization; lossy and lossless.
- Lossless optimization will shrink the file size but you will not lose quality.
- Lossy optimization will shrink the file size greatly but you may lose some quality.
# grab the repo $ git clone email@example.com:joshbenham/squish.git # change into the squish directory $ cd squish # install python requirements $ pip install --requirement requirements.txt # symlink it to your bin directory $ ln -s squish_r /usr/local/bin/squish
# check the help $ squish --help # lossless optimization $ squish --lossless image.jpg $ squish --lossless folder/ # lossy optimization $ squish --lossy image.jpg $ squish --lossy folder/ # both optimizations $ squish --lossy --lossless image.jpg $ squish --lossy --lossless folder/