Top
Best
New

Posted by surprisetalk 3 days ago

My Images Are Dithered(dead.garden)
139 points | 56 commentspage 2
meindnoch 4 hours ago|
Every image should be dithered below 10 bits/component to prevent banding artifacts.
dahart 3 hours ago||
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 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. I don’t know what the open source tools do today, maybe they’ve fixed it, I haven’t checked.
meindnoch 56 minutes ago|||
"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.

meindnoch 3 hours ago|||
Yeah. But even if you stay in the digital realm, dithering is necessary at 8bits per component. Consider that a grayscale gradient can only have 256 distinct levels.
dahart 3 hours ago||
True! You’re less likely to be surprised by banding on a display, because you can see it before it’s a problem, and it’s less likely to cost money, but for sure the need for dithering is still there, especially for displays that can do more than 8 bits per channel or can do high dynamic range.

> Consider that a grayscale gradient can only have 256 distinct levels.

This is true, but also keep in mind that for print and low dynamic range displays we humans only need approximately 256 levels, as long as the levels are perceptually spaced out evenly. 8 gamma corrected bits per channel actually made sense for a long time, for both print and for TVs & monitors, until HDR displays came along, relatively recently. Needing dithering for 8 bit images displayed on a 10 bit display is perhaps less surprising than needing dithering even when your display and your printer are both only 8 bits, right?

adgjlsfhk1 2 hours ago||
I think HDR wasn't what changed. It's resolution. At 720P and below, you don't notice dither because pixelation is the more obvious problem. Once you're at 1080p (and it's more obvious at 1440p/4k), you start having enough detail to see the banding patterns.
dahart 2 hours ago||
I don’t think I agree with that at all. Color banding is a problem with NTSC - 540 interlaced, and lower resolutions too. If you have a smooth gradient that shows color banding, spatial resolution is completely irrelevant. Pixelation is a separate, orthogonal issue. It would be trivial to show color banding, and the need for dither, on a 16 x 16 pixel image.

HDR is what changed - it requires more than 8 bits per pixel, by definition!

Again, if you only have LDR (low dynamic range), the human visual system’s “just noticeable difference” or JND in the perception literature demonstrates we only need 8 bits when looking at things under ‘indoor’ lighting conditions. You don’t need dithering if you use LDR on a single specific 8-bit display. You do need dithering when either moving to a different display than the one you started with, or using an HDR display - capable of displaying more than 8 bits of color resolution.

adgjlsfhk1 2 hours ago|||
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.
meindnoch 1 hour ago||
Absolutely! Higher precision is always better. But if you must go as low as 8bits, you should dither.
jeremyscanvic 3 hours ago||
I'm only vaguely familiar with dithering/half-toning. What does "component" refer to here?
meindnoch 1 hour ago|||
8 bit per component = 0-255 red, 0-255 green, 0-255 blue

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

adgjlsfhk1 3 hours ago|||
red/green/blue
willmeyers 4 hours ago||
Cool effect! It feels a bit like a deep-fried meme to me, but that might just be me!

I tried doing something similar a couple of years ago and gave up after running into the exact same issues in the post. It's really difficult to replicate proper halftoning on a computer screen without getting moiré patterns and weird artifacts because of PPI, aliasing, and other stuff. Beyond that, print and screens are just fundamentally different ways of rendering things.

ValdikSS 4 hours ago||
??? This is halftoning, not dithering
dahart 4 hours ago||
I’d say halftoning is a specific type of dithering. Wikipedia mentions that for print, some people consider the terms synonymous.

https://en.wikipedia.org/wiki/Dither#Applications

andai 4 hours ago|||
See also,

Surface-stable fractal dithering:

https://www.youtube.com/watch?v=EzjWBmhO_1E

And the technical deep dive:

https://www.youtube.com/watch?v=HPqGaIMVuLs

ValdikSS 4 hours ago||
Thanks, that looks cool. This is dithering in principle, but using dynamic spot functions.

To learn more about halftones, I'd recommend PDF specification, pages 303-307.

https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/p...

ValdikSS 4 hours ago||
>Is this even dithering?

>But if you care about the method this is not dithering.

> I looked it up, the translation in this case is, in fact, simply "half tones" :^)

tiffanyh 2 hours ago||
If you like this, you might also like:

https://news.ycombinator.com/item?id=48009879

Dwedit 4 hours ago||
Speaking of which, are there any good ways to undither images? Things like GIMP FFT are not perfectly reversible.
dahart 1 hour ago||
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.
Dwedit 24 minutes ago||
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.
dahart 11 minutes ago||
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.
trollbridge 4 hours ago|||
No, although AI gets really close. Dithering represents adding noise to an image and also represents doing a lossy type of compression.
jeremyscanvic 3 hours ago|||
It's a somewhat active inverse problems research subfield https://github.com/MenghanXia/ReversibleHalftoning
Dwedit 3 hours ago||
That one does not seem to be an undither project, it appears to be a special way to encode chroma information within a monochrome dithered image. NTSC television also encodes chroma within a grayscale signal, but that's different than black and white only.
qingcharles 3 hours ago||
Do you want to undither, or un-half-tone, like the images in TFA?

Unhalftoning is called descreening.

I use this:

https://descreen.net/

AndrewStephens 4 hours ago||
Very nice results, I really like the way it looks like a printed page. Image processing is addictive - once you start playing around it is hard to stop.
rrr_oh_man 3 hours ago||
Counterpoint: https://news.ycombinator.com/item?id=29227606
Yokohiii 3 hours ago||
It's an aesthetic choice. What counters taste?
dahart 1 hour ago||
That only says to not expect compression from dither, it’s not a counterpoint to using dither for any other reason.
gausswho 4 hours ago||
I vaguely recall stumbling across a site years ago that could do something like this in the browser, with various bits 'n bobs you could poke at. Can't find it now.
next_xibalba 2 hours ago||
It tickles me greatly how much HN’ers are fascinated by dithering. It seems like a few times per year a post about dithering makes the front page.
ipunchghosts 4 hours ago|
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.
dahart 1 hour ago||
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.
dist-epoch 3 hours ago|||
When someone says AI can't do something, I like to try it:

> This image features a close-up abstract scene styled with a classic halftone (Ben-Day dot) pop-art filter ...

https://share.gemini.google/O5eqZOKxwzw3

> This image is a halftone/thermal print styled photograph. The photo features a group of four people posing closely together indoors or in front of a windowed backdrop:

https://share.gemini.google/KJOxBDXYsFT4

trollbridge 4 hours ago||
I’m sorry, but I can’t understand what you’re saying at all. Explain?