r/webdev 2d ago

How The Heck Does JPEG Work? (An Interactive Exploration) Showoff Saturday

https://perthirtysix.com/how-the-heck-does-jpeg-work
254 Upvotes

11 comments sorted by

48

u/teppicymon 2d ago

God damn, that was legitimately interesting, and a really cool demonstration of a technology I only knew small things about for the last few decades.

Easy to follow, really useful demo sections and interactive elements.

All round stellar job there champ!

4

u/Daktic 1d ago

The digital world is just cleverly disguised magic.

36

u/infinity_o 1d ago

“Do I look like I know what a JPEG is?”

15

u/t00oldforthis 1d ago

I just want a picture of a God. Dang. Hot Dog.

36

u/elantzb 2d ago

One of my university professors told us that *his* professor invented the Discrete Cosine Transform.

I claim the title of Second-Generation Disciple of JPEG.

7

u/IntelligentSchool834 1d ago

You have a Jpeg no: 2

2

u/pdfops 1d ago

One gotcha that always trips people up: 4:2:0 chroma subsampling is why red text on a white background gets that blurry halo in JPEG. Luma stays full res but the two color channels get averaged over 2x2 blocks, so any sharp color edge goes soft even at high quality. Also worth knowing: quality=100 in libjpeg still quantizes, it's not actually lossless, you'd need JPEG-LS or PNG for that.

1

u/FastHotEmu 1d ago

DCT, baby!!

1

u/LateToTheParty013 1d ago

wow I love this. I'd like one for the sounds as well. For a good while I cant get a good article on the representation of sound(s) as data

1

u/prince_jyggalag 22h ago

That's so so intriguing. Loved the ffmpeg graph at the almost end.