The opposite should also be possible with the ultimate formula a giant lookup table with all the images preloaded.

Could ofc also make decompression by trying a million things.

To exist the compressed file only needs a formula to validate the result. Like it being a type 42 image with this checksum. It might take a quantum computer to confirm existence.

I had a fun idea to skip pixels and rows and make a tiny image at the beginning of the file followed by almost identical images with different offset.

Like progressive jpeg the entire image is visible almost instantly.

They could for practical purposes be seperate files too.

For mobile devices you only need the first n images for higher resolution and/or larger displays you keep loading until the resolution is acceptable or the tiles run out.

It would be wonderful for thumbnails. Display say 32x32, pre-load 256x256 and continue loading when clicked.

blur hash is an algorithm for a low res representation of an image for placeholder purposes, it's pretty nice. https://blurha.sh