Live data from Hacker News

How My Images Are Dithered

dead.garden

51–60 of 81 posts

Re: How My Images Are Dithered

#52

Why is this not a typical data augmentation method for training deep networks? It would allow the networks to learn invariants that's align with humans. Currently, I suppose none of these dithered images would be correctly classified.

Perhaps because inference on dithered images is pretty rare, not a common or popular thing to do? Otherwise, people would train on dithered images. NNs are trained on noisy images. Training with dither would not learn any other invariants besides how to see through dither, it doesn’t automatically generalize to anything else.

Re: How My Images Are Dithered

#53

Every image should be dithered below 10 bits/component to prevent banding artifacts.

I'm only vaguely familiar with dithering/half-toning. What does "component" refer to here?

8 bit per component = 0-255 red, 0-255 green, 0-255 blue

Like ~99% of images you encounter on the Web.

Re: How My Images Are Dithered

#55

Every image should be dithered below 10 bits/component to prevent banding artifacts.

The counterpoint is that you should just keep your images at 10 bit minimum or 12+ bit until the OS/monitor can dither for you. Lossy compression will do much better with a 10/12 bit image than a dithered 8 bit one.

Absolutely! Higher precision is always better. But if you must go as low as 8bits, you should dither.

Re: How My Images Are Dithered

#56
post #21

Every image should be dithered below 10 bits/component to prevent banding artifacts.

Yeah this is important when you print images, since printers can reveal banding artifacts you can’t see on a monitor. I learned this the expensive way printing a batch of large format images that had gradients in them, without dithering. This is also how I learned one way that Photoshop was for professionals and GIMP & ImageMagick weren’t; At the time (and this was years ago, to be fair), Photoshop dithered by defaul…

"This is also how I learned one way that Photoshop was for professionals and GIMP & ImageMagick weren’t; At the time (and this was years ago, to be fair), Photoshop dithered by default when going from 16 to 8 bits, while those popular open source tools did not and also did not even have good ways to do it manually by adding the right amount of noise before changing the bit depth."

Yes. Photoshop does the correct thing when going 8bit via the "Mode" menu. On the other hand, if you do "Export As → PNG" and check the "Smaller file (8-bit)" checkbox, it does NOT dither, and it produces banding artifacts.

Re: How My Images Are Dithered

#59
post #50
post #17

Speaking of which, are there any good ways to undither images? Things like GIMP FFT are not perfectly reversible.

Dither loses information, so perfectly reversible might be an unreasonable goal. But I bet you could train or fine-tune a denoiser to do a really good job. This might make a cool paper, if there’s anything at all non-standard or surprising you discover along the way.

When I mentioned "perfectly reversible", I meant the FFT itself. You run the FFT. You run the inverse FFT. Because the FFT was quantized to 0-255, you end up with a lot of stuff that doesn't belong in the image.

Re: How My Images Are Dithered

#60
post #59
post #50

Earlier quoted context omitted.

Dither loses information, so perfectly reversible might be an unreasonable goal. But I bet you could train or fine-tune a denoiser to do a really good job. This might make a cool paper, if there’s anything at all non-standard or surprising you discover along the way.

When I mentioned "perfectly reversible", I meant the FFT itself. You run the FFT. You run the inverse FFT. Because the FFT was quantized to 0-255, you end up with a lot of stuff that doesn't belong in the image.

Gotcha, that’s true. There’s gradations of non-reversible. FFT in practice is still not perfectly reversible, even if you use floats and don’t quantize to 8-bit. Anyway, yeah, dither will be even more non-reversible, but given how good today’s denoisers are, I bet de-dither could be pretty good if it was attacked with the same level of rigor as denoise has been.
Post reply on HN