JPEG from Zero to Hero: How JPEG Compression Works, Its Variants, and an Encoder You Build in Python
We follow one espresso photo through JPEG. Part 1 tells the story of how JPEG compression works: what it keeps, what it quietly throws away, and why your eyes don’t notice. Part 2 meets the rest of the family, from progressive JPEG to JPEG XL and JPEG AI, measured on the same photo. Part 3 is the tutorial: you build a baseline JPEG encoder in about 350 lines of Python that writes real .jpg files and lands within 1% of libjpeg-turbo’s file size.