3 ms·
I wrote about this very topic: https://www.nayuki.io/page/gamma-aware-image-dithering https://www.nayuki.io/page/gamma-aware-image-dithering
by nayuki 7y ago
I wrote about this very topic: https://www.nayuki.io/page/gamma-aware-image-dithering https://www.nayuki.io/page/gamma-aware-image-dithering
- microcolonel 7y agoYour error diffusion dither is strange to me. Why do you not use two-dimensional patterns like Floyd-Steinberg or Jarvis-Judice-Ninke? Is your assumption that you're diffusing error linearly in Morton or Hilbert curves? Because I'm pretty sure that's going to be outperformed in quality by any common 2D error diffusion pattern.
- contravariant 7y agoRounding to the value that's nearest in linear light is not exactly right (if anything evaluating distances in linear light is a bad idea in general, but that aside). What you want is to find out exactly how much of each colour to blend in order to get closest to the actual value and blend the colours in those proportions. The formula in the OP is the right way to do this.