mozilla/mozjpeg — pull request #101 by pornel (2014-09-03 01:12:15+00:00)
Title: Deringing via overshoot clipping

This improves compression of black-on-white text and line art with sharp edges as mentioned in #7

The trick is essentially based on making white areas even whiter, so that ringing artefacts mostly remain above the maximum level of white, and are hidden by clipping done in the decoder (all JPEG decoders must perform clipping, because even standard encoding accidentally creates overshoot values).

I've described it in more detail: https://pornel.net/deringing/

This implementation works for black-on-white details (positive overshoot) only, and doesn't attempt to do anything for white-on-black details (negative overshoot). This is because sRGB gamma makes ringing artefacts *much* more visible on white background than on black background.

This JPEG has the same file size as well-optimized PNG [source](http://www.smbc-comics.com/?id=2735). Notice how black lines are cleaner on white background than on color background:
![test-80-smbc2-catf](https://cloud.githubusercontent.com/assets/72159/4128202/c7fc58e6-3306-11e4-94cf-64641b77b00c.jpg)