News for hackers. Stuff that matters.
Re:Show HN: HiColor — convert images to retro 15/16-bit RGB ... by dmbaggett on Sunday July 11, 2021 @10:26AM (#27801086)
Curious: is the significant palette shift purely a byproduct of the limited bits per color? Or is that somehow baked into the high color format? For example the anime image gets much bluer than I would have expected. Is that a tunable parameter or just how well you can possibly do within the constraints of the format?
Re:Show HN: HiColor — convert images to retro 15/16-bit RGB ... by raphlinus on Sunday July 11, 2021 @10:41AM (#27801193)
You can absolutely make hi-color images which are close to visually indistinguishable from the 24 bit originals, by using a good dither matrix. GdkRgb did this well over 20 years ago, back when "CRT" meant a display technology, and the fuzziness made the dither patterns melt.

If you were doing it really carefully, you'd use a corrective gamma function, as dithering in a nonlinear colorspace is not an identity transfer function. Alternatively, you can do error diffusion in a linear space. But at 5 bits, the effect is fairly subtle.

Re:Show HN: HiColor — convert images to retro 15/16-bit RGB ... by dmbaggett on Sunday July 11, 2021 @11:00AM (#27801349)
Thanks — that accords with my intuition but your detailed explanation is excellent.
Re:Show HN: HiColor — convert images to retro 15/16-bit RGB ... by retrac on Sunday July 11, 2021 @03:08PM (#27803744)
Even 256 colours at high DPI can look pretty good with an intelligent dither.
Re:Show HN: HiColor — convert images to retro 15/16-bit RGB ... by networked on Sunday July 11, 2021 @10:43AM (#27801207)
The palette shift is an artifact of the current dithering (quantization) algorithm [1]. It becomes visible when you apply quantization a few times to the same image. (50 in the example. I've updated the image and replaced the "After" label with "Gen 50" to make this more obvious.) It won't be too visible to the human eye after a single quantization pass.

Edit: The result of a single pass for the anime image looks like this: https://i.imgur.com/dTmzRwF.png. I've changed "visible" to "too visible" above, because the image is visibly a little brighter.

[1] https://github.com/dbohdan/hicolor/blob/f00eac41417b0e989e1e...