Hacker News new | ask | show | jobs
by MacsHeadroom 1279 days ago
Low quality sensor photographs are all but impossible to compress because they're filled with compressions worst nightmare: random noise.

Lossless compression of random noise isn't possible and lossy compression of it requires content aware algorithms (e.g. AI) to get results.

Even if you don't readily see the random noise, it's there. Subtly changing the hues of pixels just slightly enough to be incompressible.

4 comments

And the frustrating thing is that the “noise” is actually information; it tells you something about the capture device and encoding toolchain. It’s just an incredibly inefficient way to encode “this was captured on a cheap image sensor on a severely memory constrained device”
While you can't compress the random noise itself, it's often easy to still get decent compression of the whole image, depending on how serious the noise is.

Imagine an image with large blocks of constant colour in 8-bit colour depth has 2 bits of random noise on every pixel. We indeed can't ever compress to less than 2 bits per pixel, but we can still get down to that.

They might be impossible to compress using RLE-based mechanisms, but the theoretical possibility is there. The noise range for the pixels is not 0-255, so the image has less entropy than a fuly random one and thus should be compressable.

I am imagining something like a "base layer" with averaged brightness + arithmetic coding for differences might do it.

These sorts of images do compress quite ok though (pun intended) with PNG.