toy/image_optim — pull request #6 by skattyadz (2012-12-23 13:33:58+00:00)
Title: Add jpegrescan support

image_optim doesn't optimise jpegs as well as ImageOptim.app. After routing through each, I discovered that this gem is lacking JPEGrescan support.

After adding this, my image_optim output appears to exactly match that of the desktop app, with the example image I've been testing going from a 0.30% to 6.49% reduction.

JPEGrescan works as a layer over the top of jpegtran, and I've included it in the jpegtran worker (in the same style as http://code.google.com/p/imageoptim/source/browse/trunk/imageoptim/Workers/JpegtranWorker.m). I think this is the best way to provide support without duplicating execution of jpegtran.

More on JPEGrescan: http://news.ycombinator.com/item?id=803839