3 ms·
Dithering in Games, Part 1: Simple Quantization (2016)
- dang 7y agoThis is part 1 of a series: https://bartwronski.com/2016/10/30/dithering-in-games-mini-series/ https://bartwronski.com/2016/10/30/dithering-in-games-mini-s.... We changed the URL from that to the first post, since generally it's better to link to one element of a list rather than to the list itself (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=by%3Adang%20list%20denominator&sort=byDate&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...).
- n3k5 7y agoI usually think of dither as trading spatial or temporal resolution for dynamic range. This quote reminded me that this isn't the full picture: > these computers […] performed more accurately when flying on board the aircraft […] the vibration from the aircraft reduced the error Just yesterday I came across a similar story without realising that it's another example of dither. The latest episode (#300) of NSTAAF [0] contains a bit about photorefractive keratectomy (the predecessor of Lasik). I don't want to spoil the punchline too much more, so I'll just say that Dr. McDonald, the first surgeon to try this on a living human, coined the term "trash compactor patients". Another thing I meant to reference would have been that page with those stunning visual examples of what can be achieved by combining ordered dithering with error diffusion in clever ways (it's not unlikely I got there via HN not more than a month ago). You know the one I mean? Bummer; unfortunately I didn't manage to find that link right now. But you can find interesting papers by looking up 'structure-aware error diffusion' and 'hybrid dithering'. [0] https://www.nosuchthingasafish.com/ https://www.nosuchthingasafish.com/
- the8472 7y ago> combining ordered dithering with error diffusion in clever ways I'm not sure what you mean, but the void and cluster method was published in 1993, which is a great improvement over the regular bayer pattern. The advantage of purely ordered dithering is that it is trivial to apply it in a block-wise manner, i.e. it's GPU-friendly while error diffusion methods are usually applied sequentially.
- bartwr 7y agoHey, I'm Bart, author of the blog post that got linked in this HN. :) Your points re error diffusion being way better are true; the difference is night-and-day, especially on some thin features / lines. At the same time, error diffusion is not GPU-friendly at all, especially in arbitrary pixel shaders due to its sequential pixel dependency chain (pixel xn, yn usually requires computing errors for pixels xn-1, yn; xn, yn-1 etc.). Those are much better implemented as recursive filters on CPU or even in hardware. There are some hybrid algorithms that work in tiles, but then require compute shaders and more sophisticated engineering (~orders of magnitude slower and impossible to compute "in place"). While writing that blog post series I was working in video games industry and therefore focused on real-time scenarios and "tricks".
- WalterGR 7y agoAnother thing I meant to reference would have been that page with those stunning visual examples of what can be achieved by combining ordered dithering with error diffusion in clever ways (it's not unlikely I got there via HN not more than a month ago). You know the one I mean? This one? Show HN: Ordered Error Diffusion Dithering (observablehq.com) 37 points by vanderZwan 20 days ago https://news.ycombinator.com/item?id=21682070 https://news.ycombinator.com/item?id=21682070
- n3k5 7y agoThat's the one; thank you very much!
- aharris6 7y agoI built a simple web app for dithering basic images, in case anyone wants to try some dithering of their own: https://ditherit.com https://ditherit.com