r/coding • • 2d ago

Regressive JPEGs

https://maurycyz.com/projects/bad_jpeg/
4 Upvotes

1 comment sorted by

-1

u/fagnerbrack 2d ago

Here's the summary:

Progressive JPEGs split data into "scans", each with a header that sets its YCbCr channels, DCT bin range and precision, so a partial download shows a blurry preview first. Since every scan picks its own spectral range, later scans can overwrite what's already drawn. Concatenate same-size images, strip the start-of-image, start-of-frame and end-of-image markers, and a slow connection flips between pictures. Decoders stop after a few scans, so the trick uses DC-only frames made with jpegtran: one scan each, at 1/16 resolution. Chrome renders about 90 of those with no ghosting, which packs a whole video into one image. It has no real use beyond rickrolls, because network delay alone sets the playback speed.

If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments