Re:A 100x speedup with unsafe Python
by quietbritishjim on Monday May 06, 2024 @11:20PM
(#40282019)
That article fails to touch on the fundamental issue with its title "The Secrets of Colour Interpolation"; RGB values are a nonlinear function of the light emitted (because we are better at distinguishing dark colours, so it's better to allow representing more of those), so to interpolate properly you need to invert that function, interpolate, then reapply. The difference that makes to colour gradients is really striking.
[ Parent
| on HN ]
Re:A 100x speedup with unsafe Python
by topherclay on Monday May 06, 2024 @11:33PM
(#40282099)
Do you mean converting the RGB value to LAB values in the CIELAB color space and doing the interpellation there?
Is there a better way to do it?
No, you just need to linearize the brightness.
Re:A 100x speedup with unsafe Python
by drjasonharrison on Tuesday May 07, 2024 @03:51PM
(#40290720)
Typically this is done by using a look-up table to convert the 8-bit gamma encoded intensities to 10-bit (or more) linear intensities. You can use the same look-up table for R, G, and B. Alpha should be linear.