August 4, 2015

Color Coding

For my startup I’ve been spending every free moment reading about all things photography and image related. (as well as kicking myself for never having taken a graphics course in College.) This week I’m learning about combining colors digitally. Colors are surprisingly more complicated than kindergarten lead me to believe.

Computer monitors typically display in RGB, sRGB to be exact. I’ve had some experience working with RGB before, both negative and positive. In the RGB color model each color is represented as a combination of the red, green, and blue additive primaries. The values of each component range from 0 to 255, meaning 3255, or 16.6 million colors can be represented. This color model works well for computers (and hue!) because displaying a color is a simple matter of displaying red, green and blue light in the right amounts. Three little LEDs is all you need.

The draw back of RGB is that color mixing is not intuitive for us humans. Consider blue & yellow. In grade school we learn blue + yellow = green. In RGB, Yellow is (R:255, G:255, B:0), and Blue is (R:0, G:0, B:255). Combining yellow and blue gives us (R:255, G:255, B:255) or white. The difference is that we learned color combining through pigments, which is a subtractive color model. Light is an additive one.


My startup is a technology based product for humans. I am working with an additive color model, and need it to behave like a subtractive one.

The solution I’m taking is to convert to LAB color space. The LAB model has the very nice property of being closer to “perceptually uniform”. Representing each LAB color as a vector, the euclidean distance between two color vectors corresponds to the differences in color. For small distances, at least. It turns out for large differences I need to compute the slightly more complicated DeltaE. At least I now have an algorithmic approach.

Colors can be surprisingly complex.

Posted in Internet & Technology, Work Life

Leave a Reply

Your email address will not be published. Required fields are marked *