alt.hn

7/18/2026 at 3:14:20 AM

Regressive JPEGs

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

by vitaut

7/18/2026 at 9:27:56 AM

I did something very similar with progressive (adam7 interlaced) PNG: https://www.da.vidbuchanan.co.uk/adamation/image.png

> so playback is entirely dependent on network delay

Ultimately true, but I set up my server to send each "frame" separately, with a fixed delay between each. Each frame is small so unless your network is unusually slow, the timing is set by my server.

by Retr0id

7/18/2026 at 4:48:28 PM

If you have control over the HTTP server, a different technique is to set "refresh" in the response header[1], which makes the client fetch new animation frames periodically. This is the technique used in a 2013 IOCCC entry to show a continuously updated clock that's rendered as PNG[2].

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/...

[2] https://www.ioccc.org/2013/mills/index.html

The "Refresh" header is encoded backwards on this line:

https://github.com/ioccc-src/winner/blob/619f554bbdb19e5003a...

by omoikane

7/18/2026 at 12:07:56 PM

Interesting that people are making hacks of PNG to do animations, yet there's also APNG sitting over there saying "Hey I exist!"

by Dwedit

7/18/2026 at 12:12:59 PM

You don't even need a hack, there's built-in support for this.

https://en.wikipedia.org/wiki/Motion_JPEG

I've been here screaming "Motion JPEG EXISTS and is well supported in browsers" the entire time those gif hacks were popular. I've built a bunch of cool stuff with it.

https://github.com/donatj/mjpeg-php/blob/master/mjpeg.php

https://github.com/donatj/imgboard/blob/master/main.go

The PHP example here is an illustration of how easy it is to pull off, and the Go example is part of a JavaScript-free multiuser drawing board.

by donatj

7/18/2026 at 2:53:27 PM

We even have proper video codecs like h264!

by Retr0id

7/20/2026 at 7:58:33 AM

Which can't be used in <img> tags which is the only method users have to embed media in many contexts.

by account42

7/18/2026 at 2:58:23 PM

Sure, but most sites strip the animation out of APNGs while still allowing GIFs, which is frustrating.

by qingcharles

7/18/2026 at 1:24:05 PM

I did this once, 20 years ago, with an animated GIF to add a live streaming air quality layer to a map application at work. The image itself was rendered using Java2D. I had a version I was working on that used JOGL to make gradient blobs instead of point clouds, but I couldn't get the server admin to install the OpenGL driver to get it to work.

by moron4hire

7/18/2026 at 7:31:58 AM

That is 1. Cursed, and 2. Definitely in the right place here.

by robbak

7/18/2026 at 5:56:25 PM

Meanwhile the big techs:

"Hmm how can we use this for fingerprinting"

by qurren

7/18/2026 at 8:18:05 AM

This is the stuff that I come here for.

by alterom

7/18/2026 at 11:01:58 AM

Weekend HN is definitely where the more interesting and offbeat content lives, and I often find myself enjoying it significantly more as a result.

During the week, well, it would be unfair to call it LinkedInified, but it can often feel like a somewhat higher tier of that sort of strata. Plenty of good stuff in there still, but much more “serious business”.

by bartread

7/18/2026 at 9:25:47 AM

Me too, thanks for reminding me of that

by wegwerf17377382

7/18/2026 at 8:54:01 AM

I wonder if and how you can use this for steganography, hiding data in plain sight. I bet most automated image analysis programs would only consider the final image. I sure some highschooler can use this to bypass their schools contentfilter

by tda

7/18/2026 at 9:19:49 AM

Yep this is an AI subversion technique for sure. Put the message to the humans in the first frame, and the message to the AI in the final frame.

This is how we defeat skynet: by sending each other pictures of cats.

by aetherspawn

7/18/2026 at 11:03:05 AM

You could probably implement a server that is purposefully slow enough so that the human frame shows up for however long you want. Just need to send the keepalive bytes one-by one.

by yonatan8070

7/18/2026 at 9:39:17 AM

I can't see any way this would beat regular steganography.

by mike_hock

7/18/2026 at 9:46:09 AM

> “Besides unconventional rickrolls and other trolling, this has no practical applications: there's no way to add timing information, so playback is entirely dependent on network delay.”

A progress bar for something that’s loading in parallel over the same network, to give the user an idea of how much the delay is?

by pavlov

7/18/2026 at 12:13:10 PM

If i remember correctly, some other places of the internet (4chan) completely this sort of behavior because people use it to hide images of ...unsavory topics

by NewsaHackO

7/18/2026 at 3:08:53 PM

I think you dropped a word.

by Gander5739

7/18/2026 at 5:19:07 PM

It's an onomatopoeia

by SonOfLilit

7/18/2026 at 6:32:41 PM

You mean an onomatope (to be pendantic)? In any case, it's not clear to me exactly what you mean.

by Gander5739

7/18/2026 at 9:40:20 PM

Apparently "onomatope" is a much less popular name for the same thing (e.g. Wikipedia uses my version).

I mean that the "remove a word" 'symbol' is a 'word' that represents the verb he was trying to invoke, by sounding like it.

Birds chirp, bees buzz, moderators, toilets flush.

by SonOfLilit

7/18/2026 at 10:01:29 PM

Apologies if I'm being totally thick, but you're saying the lack of a word is acting as an onomatope (or an onomatopoeia if you prefer)?

by Gander5739

7/19/2026 at 5:52:43 AM

Yes. You could say this is the sound of silence.

by SonOfLilit

7/18/2026 at 10:05:31 PM

Someone accidentally the whole thing.

by tosti

7/18/2026 at 6:20:29 AM

Nice! I think you can approximate timing somewhat, by making your web server create the "jpeg" on the fly and send it to the client in timed chunks. The source could even be a webcam, so the "jpeg" would go on forever.

by cousin_it

7/18/2026 at 6:59:11 AM

There are already webcams which do this- but they use a mime trick for 'multipart/x-mixed-replace'.

That's basically the server telling the client 'That data I just sent you, well now replace it with this new thing'.

No JavaScript needed, and can work with plain http and jpeg

by londons_explore

7/18/2026 at 9:02:51 AM

You can do this with the gif too, I have once created a toy cgi that combined a gif sending one frame at a time with an image map allowing you to Remote Desktop with no JavaScript and click around. JPEG may have been a better choice, maybe I’ll revisit this.

by iwontberude

7/18/2026 at 11:37:14 AM

I love the first JPEG where the final image is... a different picture of the cat. "The first images you see are just approximations to the final, exact version." Audience's heads nod in understanding

by akoboldfrying

7/18/2026 at 8:26:20 AM

> so playback is entirely dependent on network delay

You can use Service Worker to emulate a slow connection :)

by est

7/18/2026 at 5:54:14 PM

Weird that it’s inconsistent

Works fine for me in desktop Firefox. But on mobile iOS the “whole video within a jpeg” is 3 frames, all of which are nearly entirely solid color brown->orange->red with a vague cat silhouette. The color changes each frame, so you can tell it’s “working” but it’s certainly not what I’d call a video.

I was surprised when I pulled it up on my desktop and it did actually play like a video. Wonder if it’s causing some weird iOS image decoding glitch/edge case.

by snailmailman

7/19/2026 at 6:21:49 AM

I guess this is related, but I knew too little to tell: Safari can't do MJPEG in <img>.

by j16sdiz

7/18/2026 at 8:53:22 AM

Adjacent advice: I've recently played with opengl and jpeg turbo and I wanted to display images fast. I don't remember exact numbers, but enabling progressive for a jpeg was a significant slowdown for decoding. So if anyone like me is stuck with the old school advice that progressive is an nice to have, it's likely not. I personally don't remember any visual progressive image buildup in like decades, so it's not doing anything valuable at all.

by Yokohiii

7/18/2026 at 11:38:49 AM

>I personally don't remember any visual progressive image buildup in like decades, so it's not doing anything valuable at all.

Maybe you just don't notice? It can be pretty invisible sometimes. I sometimes notice that image soon after page load an image is slightly blurry, and then another pass "sharpens" it. Yeah it's not like in the "old times" when the first progressive level was almost unreadable, but there's still value in sending a lower resolution version of image in 30% of the total file-size, basically for free

by msm_

7/18/2026 at 2:01:45 PM

I haven't been able to see it even setting Chrome developer tools to crazy slow network speeds. Maybe chrome developer tools simulation isn't enough to see it?

The observations you are reporting are from images you created yourself and you know are in fact progressive jpegs? (not "regressive", although that's funny). There are of course other techniques to start with a lower resolution image that do "work" (in the sense of actually displaying a lower resolution image first at least).

by jrochkind1

7/18/2026 at 9:09:12 AM

Progressive decoding isn't expected to speed up decoding, it's expected to speed up displaying large image files, especially for downloads via slow mobile connections.

Example: https://youtube.com/watch?v=UphN1_7nP8U

by cubefox

7/18/2026 at 10:48:44 AM

I've started using computers in the 90s, I've seen this every day back then.

Still the question is, does it help? Trying to access an average web app will probably take minutes before the browser may even see an image. If you do everything possible to render reasonably fast on very slow speeds, then progressive is nice. On a fast connection I don't think the average user will notice the difference.

by Yokohiii

7/18/2026 at 2:38:01 PM

Where it helps is in finding out if it's even the image you wanted. You get a sense of it from the fast first pass, and then can hit back if it's not the thing you thought it was.

by phyzome

7/18/2026 at 9:27:22 AM

I use cjpegli as encoder and it compresses best with its default progressive and full 4:4:4 approach, so it's not only a nice to have feature.

by chronogram

7/18/2026 at 10:35:17 AM

I deliberately was talking about decode speed. The question is if you serve even via moderately fast infra, does it display faster? In my case on a (indeed fast) local system absolutely not. Mere size can be a decode problem of course. But it's extremely hard to tell that a single digit percent size difference is an advantage for serving.

But if better compression for storage or you can verify progressive serves faster then it is of course a benefit.

I guess the point I am making is that most people think: I heard it's somehow better so lets use it.

by Yokohiii

7/18/2026 at 6:53:36 PM

Is you have a normal CPU then does decode speed matter?

But a lot of people do have slow connections sometimes.

by Dylan16807

7/18/2026 at 9:12:37 AM

JPEG photos stored as progressive usually take ~5% less space so there is value.

And it is possible to losslessly transcode JPEG to progressive.

Lossless transcoding to JPEG XL gives even more space savings though.

by Self-Perfection

7/18/2026 at 5:44:48 PM

[flagged]

by PatuDev

7/18/2026 at 6:43:10 AM

I tried to think about difficult ways to compute the high frequency coefficients to work from the "wrong" coefficients of the first image...

But this is clever - just smash them together. Low frequency of one image concatenated with high frequency from another. This works surprisingly well!

by schobi

7/18/2026 at 6:52:18 AM

Excellent hack! Should definitely be possible to make an animated gif to jpeg converter. I guess the animation could be slowed a little by repeating frames.

by xnx

7/18/2026 at 6:55:33 AM

You can also deliberately have the server sending data at the right rate for the right playback time.

Easy enough to add a delay() each frame if your server is python/nodejs/PHP/whatever

by londons_explore

7/18/2026 at 10:20:34 AM

Wow, Firefox never fully loads the page, while WebKit fails to load it altogether, instead it displays "Operation was cancelled" in system font after a short freeze. I didn't manage to see the images change in any way as the post would suggest though, which left me confused.

by remix2000

7/18/2026 at 8:05:22 AM

Safari just freezes in place until the image is entirely finished downloading.

by LoganDark

7/18/2026 at 9:18:27 AM

Works fine for me on iOS

by aetherspawn

7/18/2026 at 8:38:15 AM

insanity of content aside, that's a really nice website. Kudos.

by Grimblewald

7/18/2026 at 3:38:21 PM

Is it possible to acquire lower frequency components with a camera too?

This also reminded me of MRI where low frequency is acquired first in a space called k-space

by smath

7/18/2026 at 4:23:43 PM

I like how that website has not just a "Dark" and "Light" mode, but also a monochromatic "TTY" mode.

by einpoklum

7/18/2026 at 8:28:52 AM

I wonder if you can do this in JPEG-XL. I know that that has actual animation support, but this would be a different thing.

by vanderZwan

7/18/2026 at 8:41:43 AM

The format supports progressive decoding but IIRC none of the current browser implementations support it. The first Chrome and Firefox implementations did, and I think it's on their roadmap for the new Rust implementation. No idea about WebKit/Safari.

Edit: the format also supports region-of-interest decoding and I suspect you can make some cool maps or fractal images with both features. But I think they're not quite prioritizing implementing that right now.

by cyberrock

7/18/2026 at 10:19:56 AM

> The first Chrome and Firefox implementations did

I was about to say: I'm sure I've seen it work a t some point? I imagine it's a valuable thing to add for the web though. It would be really cool if you could use the same image source for thumbnail and full image, and the browser both just figures out how much to download based on pixel size and can resume previously partially downloaded images.

And yeah, the tiling isn't implemented anywhere yet, jxl doesn't really get enough funding for that. But it'll be really cool once it does since it also makes it really useful for giant images of geographic data. I don't know if it combines with streaming downloads as well, but it would be crazy cool if we effectively got OpenSeaDragon[0] support inside an image format

[0] https://openseadragon.github.io/

by vanderZwan

7/18/2026 at 11:24:10 AM

Now you just have to mod your webserver to send the image chunk by chunk (with waits in-between). That way network latency does not matter. Also it probably reduces artefacts as bytes from one frame most likely are received in one network packet.

by Jabdoa2

7/18/2026 at 8:22:18 AM

If the online porn industry hasn't used it, it's probably worthless. Still funny, though.

by korbatz

7/18/2026 at 6:00:05 PM

oh i thought this was going to be a jpeg that loaded the highest-frequency data first and added the lower frequency data later

by tensegrist

7/18/2026 at 3:03:08 PM

Your website is inspiring

by ingen0s

7/18/2026 at 11:22:52 AM

my kinda hackin' so much creative potential ...

by fitsumbelay

7/18/2026 at 7:51:13 AM

hmm interesting

by solodynamo

7/18/2026 at 10:38:49 AM

Now, stuff like _this_ is why I keep coming back to HN.

by fractorial

7/18/2026 at 7:46:13 AM

My jaw dropped. Very cool. Thanks for sharing.

by ilvez

7/18/2026 at 8:15:18 AM

[dead]

by luciana1u

7/18/2026 at 8:05:35 AM

Thanks for sharing

by Pijuspaul321