Traditional photographs are created by exposing light-sensitive film to light reflecting from a scene, processing the film through a series of chemical reactions to create either a negative or positive reproduction of the scene on the film, in the case of negatives passing light through the processed film along with various colored filters onto paper coated with other light-sensitive materials, and then processing the paper through another series of chemical reactions to create a reproduction of the image on the film. Of course the entire process is more complicated than the explanation provided by a single sentence, but it's a good summary of what happens. My point is that at each stage of the process there is a reproduction, either visible or latent (i.e. stored chemically), of the original scene.
Digital photography is significantly different. Rather than an image being reproduced directly onto special film or paper, it is divided into a large number of vary small areas, and the amount of light in each area is measured by a sensor, typically a CCD or CMOS device. Of course, digital images can also be created by scanning a piece of either film or paper, but the process is the same. The digital image is a series of measurements taken of another image or scene. It's not really an image at all, but a recording of the measurements - a list of numbers. With this in mind digital devices can be broken down into two categories - those that measure an image, and those that create an image from a series of measurements. Scanners and digital cameras fall into the former category, while monitors and printers fall into the latter.
Computers store information about the colors in an image in a number of ways. The most common of these is called RGB, where each color is comprised of three different values (levels) of red, green, and blue. Since these three colors are the primary additive colors, a huge range of colors can be recorded. However computers have limited amounts of memory and digital pictures have many pixels with each pixel is represented as a specific color, so the the possible levels for each of the three color components must be limited. Using a coding scheme of 8 bits per pixel, also know as 24 bit color since there are 3 colors that require 8 bits each, allows each color to have one out of a possible 256 levels. 48 bit color uses 16 bits to record the level of each of the primaries, providing a choice of 65,536 levels for each primary color. Of course, the downside to having so many possible levels available is the requirement of additional memory and storage.
A computer image is made of many different pixels, each of which has a color as defined by the levels of the three primary colors red, green, and blue. What else is there to know? Well, what color is defined by assigning a pixel a red level of 120, a green level of 70, and a blue level of 150? (To simplify things I'll use the notation {120, 70, 150} to specify colors). I don't know, and chances are rather good that you don't either. Let's further simplify by focusing on just the shades of red for the moment. What color is defined by {120, 0, 0}? Can you picture {120, 0, 0}? OK, since there are is no green or blue component (i.e. both have values of 0) chances are good that it's a shade of red, but what shade? What's missing?
Before I answer that, let me jump off-topic a bit and discuss measuring things with rulers. Let's say I tell you I have a box that's shaped like a cube (i.e. equal sides all around) and it's very nicely made. You're interested in buying a cube-shaped box, so you ask me it's size. I respond by saying each side is 5 long. Assuming size is your only concern, you should now have enough information to know whether or not you'd like to acquire my box, no? Obviously no. The box could be 5 inches on each side, or it could by 5 feet. If you lived in a more unit-progressive country (i.e. not the United States), you might have assumed that the box is 5 centimeters on each side, or perhaps even 5 meters. I obviously didn't provide a complete description about the the size of my box. While the number was important, it's meaningless without knowing the unit of measurement used to determine and interpret the number.
Jumping back to colors, the same lesson applies. Without a clear definition of the system of measurement being used to define {120, 0, 0}, we have no way of knowing what color is being represented. Color spaces are the systems of measurement that enables us, or more accurately our computers and the devices that interface with them, to define the color. If three people's computers all use the same color space (i.e. system of measurement) and have accurately calibrated output devices, they should all be looking at the same shade of red when they view an image with the color {120, 0, 0}.
Unfortunately, until recent mostly computers weren't designed with color management in mind, with the obvious exception being the Apple Macintoshes. Furthermore, most peripheral devices aren't even designed for consistency between units of the same brand and model, let alone between different brands. Factory-calibrated devices (i.e. by design and quality control) are a dream, except again for some of the Apple hardware. When a company controls the design of the entire computer, they are able to sustain much higher quality levels than many companies trying to compete in a cutthroat market. Overall, things are improving for the Windows-based PCs, but they still have a way to go before they truly implement a system-wide color-management design, for both the operating system and applications have to support color-management.
Let's jump back to the analogy of measuring things with a ruler. Fortunately, both the Metric and English system of units allow the ability to use as many units in combination for a particular measurement as necessary, i.e. there is no upper limit to the number of inches that can be defined. For example, if I handed you a 12 inch ruler and asked you to measure the distance from my front door to the nearest grocery store, you could do it, though of course you wouldn't. But what if I was providing you with a stick having 9 equidistant marks for you to measure things and asked you not to use multiple lengths of the stick for any measurement (i.e. you're not allowed to measure an 18 inch object with a 12 inch ruler). The overall length of the stick you desired would be very different if you wanted to measure the height of growing children than if you wanted to measure caterpillars. Another consideration for measurement might be whether the spacing between increments must all be the same. If you made your living measuring the length of vehicles, you might want the distance between the first two marks on the stick to be about the same length as the shortest vehicle you're likely to come across. The overall length of the stick would be about as long as the longest vehicle you're likely to need to measure. Logically, you might want the remaining 7 marks to be evenly spaced between the 2nd mark (representing the shortest vehicle you could measure) and the mark at the end of the stick. {TO DO - add illustrative figure}Such a non-linear measurement scheme sounds crazy for measuring almost anything but cars, but it would work most efficiently for cars given only 9 marks with which to work.
How in the world does this relate to computer-encoded color? Well, depending on the scheme used to represent the color, a computer has only 8 bits per primary color to store information about a single pixel. 16 bits can also be used, but the amount of memory and storage required for the image doubles. Let's just focus on the 8 bits per color per pixel model for now. 8 bits per color per pixel, or 24 bits of color information per pixel, results in the possible definition of a huge number of colors, something on the order of 16.7 million. Wow! I struggled to use all the crayons in by box of 64 when I was kid, but of course no one ever mistook any of my colored drawings for a picture. If you consider that human vision has a more difficult time distinguishing colors at low light levels and that many of those 16.7 million colors are quite dark, you may decide that you'd like to use some of those bits defining darker colors to store color information about the brighter colors. {TO DO - another illustration would work well here} If a viewer can't observe the loss of information in the darker areas, then they might be happier to have the extra information in the brighter ones. Similarly, if all of my pictures were portraits, I might to want to use a large percentage of those 16.7 million possible color measurements for flesh tones, again hoping that people wouldn't mind the color detail lost in clothing, backgrounds, etc. if the tones of the faces had perfectly smooth transitions. Again, my point is that when dealing with only a limited number of discrete measurement values, the subject of the measurements influences the tradeoffs we make in obtaining and recording the most useful information possible.
The purpose of this article isn't to provide an in depth description of the all the color spaces available, but I will spend a few words to discuss some of the more popular ones. I'll also not include any information about the color spaces assumed by Apple's systems since I have no experience with them. Most Windows-based PCs are based on an sRGB color space. As stated previously, few equipment manufacturers worried about having accurate color capture or rendition from their devices, hence my use of the term "based on". Consider it a target rather than a requirement. The sRGB profile is loosely based on the output capabilities of most monitors. If a color can't be represented on a monitor, then why should we record information about it? Though this seems to make sense, those in the printing business don't use any variation of RGB. Whereas red, green, and blue are the primary additive colors, cyan, magenta, and yellow are the subtractive ones, meaning that putting cyan ink on a page removes red from the original white light being reflected by the page. Printers also use a fourth ink, black, due to the mechanical limitations of adding fluid to paper without causing problems. They refer to their preferred color space as CMYK, where K is used to represent black (B could be too easily confused for Blue).
Unfortunately, several of the colors such as the bright, vibrant yellows that can be created in CMYK are not defined in the sRGB color space. If you can imagine the color wheel, RGB forms a triangle on the wheel with the outermost points being the brightest red, green, and blue colors. CMY also forms a triangle, but the two triangles are rotated on the wheel with respect to one another, so both color spaces contain colors in the extreme points of the triangle that cannot be defined by the other color space {TO DO - FIGURE showing color wheel with triangles}. How do we get more colors to exist in both the RGB and CMYK color spaces? Use a bigger circle for one of them. This is exactly what the Adobe RGB color space does. By using a bigger triangle for the RGB colors, more of the CMYK colors are included in the RGB space. Of course, we still have RGB colors that can't be printed, but that's the limitation of the printer device, and increasing the color space won't provide any benefit. In short, most photographers working with digital images use Adobe RGB as a compromise between colors viewable on monitors and those that can be printed. Of course, we also hope that technology improvements will allow more of those wonderful colors to be both displayed on monitors and printed.
At this point you may be asking yourself why not just use all colors perceivable by human vision as the preferred working color space. We could, but the computing resources required to handle all that information would be much greater than it needs to be. Since most input and output devices cannot even come close to representing the full range of human vision, all those extra bits would be carried around quite needlessly. Most people today would rather have more pixels rather than more color choices. Again, the Adobe RGB (1998) color space provides the best compromise for an efficient use of bits recording colors viewable on monitors and printable to inkjet or other output devices. Someday when the peripheral devices are more closely matched to the limits of human vision we may add more bits to store the color information since computers will also have progressed a great deal by then, but for now we work within the limitations that exist in the equipment.
Let's digress to the box measurement example again. When I said the box I had measured 5 inches per side, you, the potential buyer, were then capable of understanding the size of the box. In this case, I assigned the units of inches to my measurements. If you lived outside the U.S. and weren't familiar enough with the size of an inch to gain a visual perception of my box, you would most likely look up that 1 inch was is equal to 2.54 centimeters and calculate a box size of 12.7 centimeters per side. By doing this you have converted my numbers to ones he can more easily understand.
The same is true for colors. Assuming the image editing program you use implements color management, when you open an image file that hasn't been tagged (i.e. assigned) with a color profile, the program will want to know what color space or profile is associated with the numbers in the file. Regardless of the choice you make, an assignment is about to occur. Even if you choose not to use color management, the program has to make assumptions about what those numbers mean, so it will default to assigning the application's working color space to your image. It may or may not save this assignment to the file when you've completed your work, but while you we looking at it and making your changes and assignment had been made.
During your edits you may wish to convert the numbers in the image between color spaces. This most commonly occurs when opening a file created by a scanner or digital camera, when saving a file to be viewed on the web, or sending your file to a professional printer. In the case of opening files from a scanner or camera, you may have assigned the device's color profile to the image before converting it to your working color space. If you're working color space isn't sRGB, you will probably convert the image from the working color space to sRGB. When such conversions are made, the appearance of the image after the conversion will be as close as possible to the appearance of the image prior to the conversion, but the numbers defining the colors will change. Assignments are just the opposite - the numbers remain the same but the interpretation of those numbers changes significantly, and therefore the appearance of the colors will change as well.
Let's look at an example showing the effect of assigning three different color spaces to the same numbers. The following figure shows three different color patches:
Believe it or not, all three patches were created by filling a square region with the color {203, 99, 61}. The difference in color that you see is caused by the fact that I used three different color spaces to define what the numbers meant. From left to right, the color spaces used are sRGB, Adobe RGB (1998), and Wide Gamut RGB. Note that even though I created the colors in three different color spaces thereby effectively assigning the color spaces to the numbers, I had to convert the numbers to a single color space, sRGB, for displaying the patches on the web. Since I knew that these three color patches would ultimately end up in an sRGB image file, I purposefully chose a color that was within the gamut of all three color spaces.
Let's look at another example of a real image taken with a Canon EOS D30 camera:
Is it "wrong" to assign a color space or profile to an image that was recorded using another? Not if you do it purposefully to achieve a specific result. As the three figures above show, assigning different color spaces to the numbers in an image file will alter the appearance of the image. Some may actually prefer the middle image in which sRGB data was assigned the Adobe RGB (1998) color space. Though the colors in the image are more vivid than what was seen at the time the photo was taken, many find the extra saturation to be a desirable quality, much like people's preference for Fuji Velvia film that is known to accentuate colors. Such color mismatching is analogous to purposefully breaking the rules in film-based photograph, for example overexposing and processing film at a greater speed than its ISO rating to increase grain. In fact, using different color spaces or color profiles for the output of a digital camera may be a quick way of simulating the effects of using different types of film. Canon may be doing something similar to this in their latest software drives for their new EOS 1D digital SLR. Unlike the EOS D30 files, I believe the files from the 1D are tagged (i.e. have been assigned) with either the sRGB and Adobe RGB (1998) color spaces, but there are also settings for variants of sRGB to be used in specific situations. For these I suspect that the color-encoding algorithm that converts the RAW images from the sensor into the sRGB images may be mapping colors slightly differently into the sRGB color space. Of course this is all speculation since I don't happen to own an EOS 1D.
OK. Now that hopefully you are comfortable with the idea of a color spaces, let's move on to discuss color profiles. These aren't really any different than color spaces (i.e. a system of measurement) described above except they apply to a specific device. One thing not mentioned previously is that inherent in the concept of a color space is the ability to relate that color space to another common, standard color space, usually LAB. This is also true with the profiles. Again using the ruler analogy, if we had to communicate to others our measurements using the car ruler described above, they would either need to have the same type of measurement stick or we would have to tell them how to convert the numbers from our stick to ones they could use with whatever stick they had. If I didn't know what they're stick looked like, I could tell them how to convert my numbers into a common measurement system, like centimeters, and then they would have the responsibility of converting the numbers from centimeters to something that made sense for their stick.
On computers, the mechanism used to describe the conversion of colors either coming from an input device or going to an output device is the color profile. Since color profiles are used to characterize a wide variety of devices, including scanners, monitors, printers, and digital cameras, the files describing the device profile are typically much larger than the files describing a color space. On my system, the color profile files for my printer are between 100 and 1,000 kilobytes, but all the color space files defining standard color spaces are about 0.5 kilobytes. The profiles are created by processing an image with accurately known colors, comparing the difference between is known about the colors and how the computer processed the colors, and defining a color profile that will minimize the differences. This usually requires dedicated color measurement devices, though an adequate job may be done by someone with a good sense of color. In fact, some of the color profiling software allows the user to tweak the profile created by the measurement device to suit they're particular taste.
If you'd made it this far you may be asking yourself why does all this matter. If you're able to take a picture either digitally or scanned from film and both view it on your monitor and print it with colors that satisfy you, then everything above is probably not of much value to you (perhaps I should move this to the first paragraph!). BUT, remember that things change. As your monitor grows older, it's display characteristics will change. Colors that once seemed bright and vibrant may start to become more muted. Even worse, should one color start to fade faster than the others, color shifts will occur. As a result there will be an increasingly large disparity between what you see on the monitor and what is printed. OK, so you go out and buy a new monitor. Now you've really done it. Colors are even more off between what you see on the screen and what is printed. Trying to avoid this mess requires you to do some form of calibration and adjustment from time to time, but not necessarily that you fully understand color spaces.
However, if you want to exchange files with others or have a professional printer (i.e. a person making their living making prints, not the expensive thing on your desk connected to your computer) create a large high-quality print from your file, you may be disappointed if you haven't considered both the calibration of your system and the management of the interpretation of all those numbers throughout the process. Of course your disappointment may not be as great as that of the many scientists and engineers who sent a spacecraft plummeting to it's demise on Mars because of calculation errors resulting from inconsistent units. After all, what matters isn't the accuracy of the color measurements made by our cameras, but the ability to create an image that depicts what we wish through careful control of the entire photographic, editing, and printing processes. Ansel Adams spent a great deal of time and effort to fully understand the chemical processes for photographic film and papers, and it was through that understanding that he was able to visualize the final print when looking at a scene and to control the process well enough to achieve the output that he desired.