I’d like to process all JPEG thumbnails generated with easy-thumbnail via PIL thru jpegoptim.
Using PIL’s optimization: image.save(..,optimize=1,...) isn’t optimizing much at all.
For example:
- with PIL: 123KB
- with PIL + optimize: 112KB
- with PIL + optimize + jpegoptim: 52KB
Can anyone point me to Python examples or libraries that integrate jpegoptim?
I found https://github.com/thebeansgroup/smush.py which is a lossless image optimiser in Python >=2.7. I went with https://github.com/beatak/smush.py which is a fork that works for Python >= 2.5, since we are using debian stable on our server.
It uses:
Hopefully using pngnq multiple times on files doesn’t degrade quality, we plan to run this script on all uploaded media weekly.