|
Color: Perception and Representation |
|
|
Perception In physics, the visible spectrum of light is composed of an infinite number of discrete or single wavelengths of light. At each wavelength a pure color is defined. The shortest wavelengths we can see are perceived as violet and the longest as red with blue and green shades being somewhere in-between. Of course, mixtures of wavelengths are typical. White light is the result of all wavelengths being present in equal amounts and in a color such as magenta, red and blue wavelengths are present to the exclusion of all others. "Color" is a concept having to do with perception, interpretation and other subjective factors. For example, the eye responds to certain groups of discrete wavelengths added together as if they were a single wavelength not shared by any constituent of the group. This is very odd - and useful. It has been discovered that combinations of only the red (R), green(G) and blue(B) discrete wavelengths in various proportions can cause the eye to perceive most of the other discrete colors as well as combinations of other wavelengths. For example, R plus G is perceived as pure yellow even though there is no yellow wavelength present. This situation is fortunate because it vastly simplifies color presentation. As an example, a TV projector needs only 3 color sources (Red, Green, Blue) as opposed to thousands. R, G and B are usually referred to as the primary colors with their fundamental combinations ... R+G = Yellow(Y) R+B = Magenta(M) G+B = Cyan(C) ... called the secondary colors. As an interesting digression, note that Yellow is present as a discrete frequency in the physical color spectrum but Cyan and Magenta are not. How interesting. So far, Additive color representation, which applies to images viewed by means of transmitted light, has been described. In this system colors are added to produce other colors. This is usually called the RGB system of color representation because it uses the three primary colors. In addition to the three primaries, a white value reference point is also required. Examples of technologies using additive presentation are computer monitors and TVs. Additive systems are implemented in these two principal ways:
Much of the real world is viewed by means of predominantly reflected light. In this mode of color presentation the subject being viewed comprises materials that absorb some colors while reflecting others. This is the Subtractive mode of color presentation and is usually called the CMYK system of color representation because it uses the three secondary colors in conjunction with a black (K) reference. Landscapes, painted surfaces and color prints are all examples of things whose colors result from the subtractive process. Suppose you are looking at a green painted wall in white light. For it to appear green, the material comprising the paint has to absorb red and blue while reflecting green, as follows: If the paint comprises Cyan (B+G) and Yellow (R+G) pigments or dyes it is apparent that the Cyan absorbs Red (while reflecting Blue and Green) and the Yellow absorbs Blue (while reflecting Red and Green). Combine them and the Blue that would be reflected by the Cyan is absorbed by the Yellow and the Red that would be reflected by the Yellow is absorbed by the Cyan. The only primary color both reflect is green so that is what you see. If we added a Magenta (R+B) pigment to the paint, Green is absorbed and we would have black paint. You might reasonably wonder why bother with all of this mixing of pigments and inks? If you want green, just find something that absorbs red and blue while reflecting green and be done with it. This is actually done and is often found in nature as well. The challenge lies in implementation where we need to produce many colors from a single source (a printer, for example). If we used dyes and inks uniquely selective in this way we would need a huge number of them. The beauty in using C/M/Y dyes and inks is that with just those three in the right combinations we can theoretically produce almost all the other visible colors just as we can with R/G/B when using additive technologies. In practice, all dyes and inks have limitations so it is common to see printers using 8 or so canisters including not only the official secondary colors but variants. Black is always implemented individually because adding all the dyes to absorb all colors never works quite as well as a dedicated "color" for this purpose. Click HERE for an excellent tutorial in color perception. The rest of this article assumes you have read or already understand the concepts discussed there. Representation and Properties Color in the Digital World Everyone knows about the primary colors red, green and blue (RGB) in the additive method of color presentation. By adding these in various ways we can produce just about all the other visible colors, thanks to the strange way the eye works. In the digital environment a color is represented by 3 numbers, one for each of the primary channels. Pure, saturated red (in 24 bit encoding or 8 bits per channel) would be 255,0,0. Brightest yellow, being red + green, would be 255,255,000 or for a darker shade of yellow, 120,120,000. Each group of such numbers defines a "pixel" and when presented to a color display or printer, the device uses these numbers to show the actual color. Increasingly, colors are being represented by 16 bit numbers which vastly reduces the difference between available shades. This mode of representation offers a number of advantages when processing images although I have never been able to see the difference in the finished product. 8 bits per channel is the encoding assumed throughout this document, as a simplifying choice. Color spaces have been defined elsewhere, including the Introduction. If you missed the discussion, click here before continuing. In each color space, this trio of numbers means something different in terms of what color is actually meant. In aRGB the greens are compressed more to accommodate the additional shades of green supported so 0,200,0 would be a somewhat different brightness of green than in an sRGB space. Put another way, the difference in shade of green represented by the difference between 0,120,0 and 0,180,0 is less in sRGB than in aRGB. A negative consequence of a large color space is that if using 8 bits/channel, the greater color compression is more liable to result in abrupt changes in shade, producing contouring effects. It is often desireable to use 16 bits/channel with these larger spaces. HSL vs RGB You will often see these terms used in the context of image processing. RGB: We already have an idea of what RGB means. To elaborate further, the RGB additive system with one digital channel for each primary number is extremely computer friendly. It is easy to encode colors this way and deal with each of the three channels individually in software to produce other shades and tones. By varying the numeric levels relative to each other or in concert, the parameters "saturation" and "brightness" or "lightness" can be altered. Physicists and geeks feel very comfortable talking about the RGB model. Digital cameras, scanners and monitors all use RGB representation. It's just easier that way. HSL: This stands for Hue, Saturation and Lightness. By varying these 3 parameters you can achieve the same things as with RGB processing. In HSL the property of a color that we associate with a familiar color value (pink, aqua, etc) is "hue", purity of the color is "saturation" and its brightness is "lightness". So, why the two ways of analyzing color when they are really the same thing? We already know RGB is machine friendly and easy to work with in that environment. HSL talks about colors in the way most non-computer people would tend to do, including artists, graphics designers, etc. It just seems more intuitive. Saturation and lightness are intuitive concepts right out there in the open as segregated entities rather than being spread across three channels. You need only one number for each. Processing software usually gives you a choice of working with your image using RGB sliders or HSL controls. It is almost always easier to pre-visualize and adjust for a desired result using the HSL controls. Behind the scenes, of course, the software is translating these adjustments into RGB equivalents. I have never heard of any software working directly in HSL. Summary of Color Properties (using the HSL model):
These three properties form the three axes of an HSV or HSL "color space". Each point in that 3D space represents a color of a particular hue, saturation and brightness. We can do the same thing with additive colors, together with a "white point" reference to form an RGB color space. Saturation This refers to the dominance of a color in relation to other colors. 255,0,0 (see "color channels" below) is pure red at maximum intensity and is maximally saturated. A de-saturated red pixel might be represented by something like 180,60,60 which indicates white light present. This is a nice shade of medium pink. You could describe it as 120 units of pure red with 60 units of white light (60,60,60 - darkish gray) added. The ratio of red to white light in this pixel is reduced. When you alter saturation using something like your imaging software, channel strength is changed differentially with the dominant channel(s) affected more. For example, if you have the color 100,20,80 and increase saturation by 28% you will wind up with 115,4,87. Green is reduced while red and blue move up but red more than blue because it was higher to begin with. The over-all brightness does not change much. The concept is somewhat complex in theory and execution. Gamma This is a measure of image/monitor response to changes in tonality. It doesn't quite fit with a discussion of color but is so important to how colors finally appear in an image it makes sense to introduce the concept here. Gamma is represented by a curve running from pure black to white. The portion of the curve representing image mid-tones is the most important part. An image with Gamma = 1 has brightness increasing from 0 to maximum in a 1 for 1 relationship between actual light intensity (as measured coming from the real world subject) and the progression of numbers representing brightness in the image file. RAW images straight out of a camera have a Gamma of 1 and look terrible because they are too dark. It is pretty much a universal standard to apply a Gamma of 2.2 at the point of display. This boost complements the contrast response of the human eye. To complicate things: your imaging software will provide controls to fiddle with contrast and image gamma. If you accept those changes, they become a permanent part of the image, unlike monitor Gamma. Of course, you will be eye-balling the effect at your monitor. What you are seeing is: monitor gamma (2.2) + user applied contrast changes but only the user applied changes are saved. There is considerable inconsistency amongst imaging products in the way Gamma controls are provided. For the most part you don't have to worry about Gamma. Just remember that if required to make a choice, such as during monitor calibration, pick 2.2. Koren's site has an excellent in-depth discussion of Gamma. Color Temperature The full definition is complex and worked out in the field of physics. As applied to monitors, it characterizes the color tint the monitor temporarily applies to everything it displays. CT is given in degrees Kelvin and represents the color of light radiated by an ideal "black body" at that temperature. Color temperatures in the range 5000K - 6500K or so approximate daylight. Monitors calibrated within this range will present a minimally biased appearance of colors in typical daylight viewing conditions. Lower CTs impart an increasingly reddish hue ("warm") while CTs above 6500K appear increasingly bluish ("cool"). Most LCD monitors today are delivered out of the box set to 6500K and a Gamma of 2.2. More correctly, they are alleged to be set that way. There is considerable deviation from the standard. |
|
|
|