Image compression

Some recipes for reducing disk size of images

PNG, lossy:

pngquant -f -v --ext .png --quality 70-100 --speed 2 --skip-if-larger FILE.png

speed: default 3, 1-11, more is less quality and faster processing
quality is the target quality to aim for

PNG, lossless (also, as a post-pass on the lossless png)

optipng -o7 FILE.png

-oN: 7 is the slowest and the smallest, usually -o3 is a good tradeoff.

JPG, lossy:
find . -name "*.jpg" | xargs jpegoptim -m 80 -t

JPG, lossless:

find . -name "*.jpg" | xargs jpegoptim -t