Linear Interpolation between Points in Color Space

Post date: May 01, 2011 6:35:51 PM

To create a gradient or a continuous colormap, we select some colors, and then do linear interpolation to fill in the rest. After reading about the Lab color space, which is made to resemble the human perception system, I wondered excactly how large the differences where in this linear interpolation. A short python script later, with good help from the color-math package, here is some results:

When interpolating from red to green in RGB space, we get this un-intuitive brown in the middle. Furthermore, lchuv and lchab looks very similar to xyY and xyz, but changing the initial colors a bit reveals their dissimilarity.

LCHuv and LCHab is very similar to HSV and HSL, but they do avoid the luminance spikes at yellow and light blue (which is one of several reasons why we should avoid the rainbow colormap). It would be interesting to test which of these gradients actually performs the best, e.g. show a color, and rate it from 0-100 in where it lies between the start and the end.

Code available if requested.