JPEG and wavelet compression in practice is surprisingly simple math. But the theory that explains why and how it works is far from trivial.