4 ms·
The article doesn't put enough emphasis on the need for gamma correction. If you dither a pure gray area of level 128, it will become approximately 50% white an
by mark-r 9y ago
The article doesn't put enough emphasis on the need for gamma correction. If you dither a pure gray area of level 128, it will become approximately 50% white and 50% black. But when you display that back on the screen, because of gamma effects it will look closer to a level of 186!
A few years ago there was a need for 15-bpp or 16-bpp color images on phones rather than the 24-bpp images we usually work with, and dithering was a great way of producing them. No idea how much need there is today though.
- 05greg 9y agoDithering is still needed for most of sRGBs range, Frontier needed to do it in Elite Dangerous where banding was noticeable. This paper: https://www.cl.cam.ac.uk/~rkm38/pdfs/boitard14hdr_colorspace.pdf https://www.cl.cam.ac.uk/~rkm38/pdfs/boitard14hdr_colorspace... compares the bit depth necessary for contouring due to quantisation to become imperceptible across a few encodings, most of them in the 10-11 bits per channel area.
- mark-r 9y agoThanks for the link. Some years ago I was shown a simple gradient that had noticeable banding on an 8-bit display; until that point I had believed that 8 bits was just beyond our ability to discriminate.
- microcolonel 9y ago24bpp is not enough for shallow gradients which don't come from a photographic source (especially in dark images). I frequently dither 48bpp material for 24bpp displays. I typically use Sierra Lite. I've recently been experimenting with error diffusion along continuous space-filling curves (I forget where I saw this technique first), and using color difference functions (CIEDE2000) to gauge quantization error. These are overkill, but it sure beats doing it the same boring way forever. Frankly, I would like it if the CRTCs attached to modern GPUs had some ability to apply dither (even just ordered dither) to buffers as they're scanned out, while exposing more precision to applications.
- jacobolus 9y agoUnless you are integrating many pixels (how many and with what weights depends on the future processing, intended output, and viewing conditions for the image) I would not expect using a fancy color difference formula for comparing individual pixels to give a particularly useful result. Indeed, the whole point of dithering (especially with high resolution output) is that we can adjust the average light coming from a several-pixel-wide blob by brightening or darkening individual pixels, and thereby make finer distinctions in light level, since the individual pixels are not really noticed. I’m also pretty skeptical about the space-filling curve thing. Those both sound like placebo features to me.
- microcolonel 9y agoWell, I did say experimenting, didn't I? I found the thing which inspired my space filling curve exploration: https://www.compuphase.com/riemer.htm https://www.compuphase.com/riemer.htm The Butteraugli score between the standard lena and the Riemersma dither is about 0.5 better than the standard Floyd-Steinberg one. Approaches like this come closer to back-propagation of errors, the lack of which is where some of the artifacts of unidirectional dither come from. In practice, any decent (full bleed) error diffusion dither works perfectly fine going between 16 and 8 bit planes, but why shouldn't I try some things out which (as you are quick to point out) may have very little value. Heck, even gamma correction isn't strictly necessary when you're going from 16 to 8 bit sRGB.
- mark-r 9y agoYes, once you start working on a very small segment of the curve it's close enough to linear and gamma correction becomes overkill.
- jacobolus 9y agoI could see it making a difference in average color of very noisy regions, especially brightly colored ones. I suspect you could deliberately construct an image where the difference could be seen by human observers.
- dahart 9y ago> No idea how much need there is today though. Lots, if you're into printing. Banding that's invisible on a monitor can become a monster when printed. An expensive monster mistake if you're printing a poster sized giclee. This is a big reason why Photoshop dithers by default when going from a higher range down to 8 bits per channel. Another reason the need for dither might be even increasing today is that digital cameras have only very recently gotten better than an 8 bit signal to noise ratio. We've had 16 bit RAW formats for a long time, but most cameras still had noise that was greater than 1/256. I tested one of my old Canon EOS cameras and found even in very well lit conditions, it's signal was a little over 5 bits, even though I could get a 16 bit image file out. With the newest cameras, the signal to noise is sometimes exceeding 12 stops, so photographers might be running into banding issues in RAW images more often. Except a lot of them never notice because Photoshop quietly handles it.
- jacobolus 9y agoIt would be neat if more people used “hexagonal” (i.e. in an equilateral triangle grid) pixels for capture, processing, display, printing, etc.; with higher and higher resolutions and fast GPUs (so that high-quality resampling can be done on the fly) it should be entirely possible to swap out individual parts of the pipeline without losing quality or performance (at the expense of a bunch of work to implement something nonstandard). A lot of artifacts are easier to deal with on a hexagon-pixel grid. Halftoning and error-diffusion dithering work really well.
- dahart 9y agoOoh, interesting thought! I think I might have used a hex image to make a game at some point, but other than that I have little experience with them. Do you think the overall benefits of hexels would make it worth trying to standardize the pipeline? I'd guess that the need for error diffusion and half-toning might wane in the future. (Not sure about that, but that's what I'd guess.) Are there other benefits you get with hex images?
- jacobolus 9y ago
- nayuki 9y agoGamma correction is very important when dithering at low bit depths. Demo at 2 bits per channel: https://www.nayuki.io/page/gamma-aware-image-dithering https://www.nayuki.io/page/gamma-aware-image-dithering