Theoretically, if you somehow take an object and get it to oscillate vigorously, as fast as 450 THz, it would emit red light. But we don’t see the leaves in the trees vibrating at 550 THz to appear green. Instead, they work at the molecular level, with the pigments absorbing all the other colors, and leaving out green. But what if we’re looking at the image of leaves in our computers? The simple answer would be to say that the computer has little bulbs of red, green, and blue, which light up appropriately. But surely, we can do better.
Older monitors like Cathode Ray Tubes used electron guns for achieving this. There were three of them, for (you guessed it), red, blue and green. LCDs work by using liquid crystals to rotate polarized light. Liquid crystals are solids with some of the properties of a fluid. The crucial property is that they maintain their orientation, which is what allows polarized light to be displayed correctly when a transistor rotates them. Each pixel is then controlled by polarizing filters, which generates the desired color.
fig. 1 The working of an LCD
Humans can see up to 10 million colors, and there are creatures that can see more. For instance, some birds and bees can see well into the ultraviolet light or infrared ranges. So how do computers see color? There are many models for this, the oldest being a 4-bit CGA system, which was composed of 16 colors.
fig. 2 4-bit CGA system
Computers represent colors through color models – as tuples of numbers. Going by the vector-like definition, the resulting set of colors produced by the tuples is called a color space. Consider the sample image of the clock tower below.
fig. 3. BITS Pilani’s iconic clock tower
One type of space is the human tristimulus space or the LMS space – the way we perceive color. Humans sort colors into three broad divisions and merge them to visualize the color. Humans perceive colors as belonging to long, medium and short wavelengths, or essentially, red, green, and blue colors. Black is as close as it gets to the absence of light, while white is just a vaguely defined smudge of bright color. Additive mixing of colors in this space is similar to adding vectors of light – and this helps us perceive complex colors, which are ratios of simpler ones. This kind of analysis is very helpful in determining color blindness, as the lack of ability to see color comes from the lack of the cone cell in the eye for that type.
The RGB color model is the most common of all image models, and it is composed of red, green, and blue images. They are widely used across digital media. The pixels are represented as a 3-tuple, as (r, g, b). Commonly each color varies from 0 to 255, giving a total of around 16 million possible colors. It is an additive model, with beams of each light of appropriate intensity are superimposed on a blackened out background. Black is simply the absence of other light, which can be at the lowest intensity. White is assumed to be maximum intensity, with all colors shining at their brightest. RGB, having three dimensions, is sometimes also represented in a cube, with each axis representing the intensity of a color.
fig. 4A RGB cube, fig. 4B RGB colors mixing
Splitting the image of the clock tower into its constituent colors gives the following result:
fig. 5 Isolated RGB channels
Printed media prefers the CMYK color, which works on subtractive principles. The model works by masking colors on a white background – hence subtractive. Cyan is red absorbing, magenta is green absorbing, and yellow is blue absorbing. In practice, the CMY inks are reflective, making a neutral black impossible. The mixture of these colors give a perfect grey, but not a black. To compensate for these deficiencies, the K, which stands for black, is used to fill up the lighter spots and save costs. The colors are printed as halftones – or colored dots which conserves ink while providing the illusion of solid color.
fig. 6 CMYK color mixing
The image of the clock tower in the CMYK system is represented here. The darker portions of the original image where light has to be absorbed are colored because the inks absorb light. The dark portions in the image below are the visible ones. The K image has white wherever the black must be overlaid – it is an inverted color image.
fig. 7 Isolated CMYK channels
The HSL system is unique in that it has different parameters for image evaluation. Again, all the image data is encoded in a 3 tuple, with each value standing for Hue, Saturation, and Luminance. Hue refers to the color, generally represented as an angle in the color wheel. Saturation refers to the intensity of the color at that particular pixel, while luminance is the brightness of the pixel with respect to similarly illuminated white. Unlike the RGB model, the HSL model is represented on a cylinder. It has the edge over the other systems owing to the lack of intuitive relationships between the three colors red, green, and blue. For instance, while viridian and lime green appear to be close, in practice, red and green have to be increased, and blue reduced. However, increasing the luminance with which viridian manifests itself and a slight change in hue and saturation should produce the same result.
fig. 8A Color wheel, fig. 8B HSL cylinder
The flaw in the HSL system is the lack of ability to visualize an image as opposed to a color in this system. The hue has to be represented as a quantity and not as a color in the wheel. This might cause some awkward representation as the hue extraction is encoded in a grayscale image below. The saturation image, which is supposed to stress on the intensity of the colors is mostly dark with respect to the pastel-like colors in the original image. The luminance image is quite bright, which ties up with our expectations.
fig. 9 hue, saturation and value channels
Human color vision is modeled in these ways onto computers for representing our images on monitors and print matter. Yet there still exist many colors which are so brilliant in their characteristic that they cannot be represented by a computer. Artist Stuart Semple created a library of colors where the colors were saturated so much that our current methods of encoding colors aren’t good enough to visualize them. Similarly, vantablack, the most absorbing material, or loosely, the blackest black is so dull, switching off our screen won’t simulate it. An image of the sun would be false color too, as the pixels won’t be as bright as the sun.
Color calibration is an important concept in computer vision, where computers are used to make intelligent decisions based on what they see. Color encoding methods are also crucial in the development of better AR/VR systems and more modern screens. So what are we waiting for? We are ready to color the world!