There's been some discussion on HN [1] of this IOCCC-winning program by Fabrice Bellard before, but no real explanation of how it works. This post is my attempt at a thorough exegesis (and something of a tutorial on modern lossy image compression techniques).
At some point, I plan to write a followup post describing the encoder that I wrote. Enjoy!
[1] https://news.ycombinator.com/item?id=17011872