# How JPEG Works: An Interactive Exploration of Lossy Compression

Original title: How JPEG works: Interactively explore JPEG's lossy compression methods

> Hacker News story 49070810 · language: en · submitted 2026-07-27
> Web version: https://zeli.app/story/49070810
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 128 · by [at1as](<https://news.ycombinator.com/user?id=at1as>) · 💬 14
[original](<https://cgjennings.ca/articles/jpeg-compression/>) · [HN discussion](<https://news.ycombinator.com/item?id=49070810>)

## Summary

I explain the enduring success of the JPEG standard by breaking down its lossy compression techniques. We isolate brightness from color, discard less critical visual data based on human perception, and convert images to the frequency domain. This interactive guide lets you manipulate encoding steps to see exactly how file sizes shrink while preserving image quality.

## Key quote

> It’s not the notes you play, it’s the notes you don’t play.

## HN discussion (14 comments)

### [herf](<https://news.ycombinator.com/item?id=49126867>)

> Nicely illustrated, and only one criticism: our preference for luminance (using more bits for "Y" vs "Cr/Cb") isn't due to the number of rods in the eye - there are so many rods so that we can capture more photons at night, and they are usually saturated at daylight illuminances. 
>
> The effectiveness of the YCbCr encoding is much more related to the predominant pathway to the LGN (80-90% of the "number of bits" used) encoding luminance and center-surround, so those things both map well to using more bits for "Y".

### [netsharc](<https://news.ycombinator.com/item?id=49128056>)

> There's a series of videos showing the algorithm: https://www.youtube.com/watch?v=LFXN9PiOGtY
>
> I finally understood DCT after watching https://www.youtube.com/watch?v=Q2aEzeMDHMA
>
> And someone created a "JPEG to PNG" tool that "finds the smoothest possible picture that encodes to the given JPEG file": https://github.com/victorvde/jpeg2png . I tried it with some very terribly compressed images, and the outputs were a lot better.

### [greatquux](<https://news.ycombinator.com/item?id=49128031>)

> I remember when I first learned about the difference between spatial and frequency domains. I didn’t actually get it fully during class. But during the walk home I had to stop and sit down and think about it… I started to “refactor” all of human history into frequency changes! It’s a pretty interesting concept.

---

## Cite

- Page: https://zeli.app/story/49070810
- Date: 2026-07-27
- Source: cgjennings.ca (https://cgjennings.ca/articles/jpeg-compression/)
- Hacker News: https://news.ycombinator.com/item?id=49070810

## Other languages

- zh: https://zeli.app/zh/story/49070810 · markdown: https://zeli.app/zh/story/49070810.md
- es: https://zeli.app/es/story/49070810 · markdown: https://zeli.app/es/story/49070810.md
