Pictures of Color Spaces Inside CIELAB
Pictures showing the location of "paint chip" colors in the CIELAB color space are used to introduce important color management concepts: CIELAB's "L", "a", and "b", color space profiles, mismatched color gamuts, and reference color spaces. Three working spaces (ProPhotoRGB, sRGB, and AdobeRGB) and three device profiles (camera, monitor, and printer) are compared to one another by showing their locations in CIELAB space.
Written in 2011-2012. Updated February 2015.
Finding your way around the CIELAB color space: "L", "a", and "b
Like watching paint (chips) dry
To the left is a very boring picture of some brightly-colored paint chips sitting on a smooth sheet of white plastic. This picture started out as a raw file and was converted into sRGB for display on the web. The image was deliberately slightly underexposed and no color enhancements were made, which is why the background is dingy instead of white and the paint chip colors aren't particularly bright.
This boring picture of paint chips is here because I'm going to show you where the various paint chip colors are located inside the CIELAB color space. In more interesting pictures (like the ones you work on in your digital darkroom), all the colors meld and blend with one another.
Pictured below are two 3D views of the paint chip colors situated in CIELAB space. The paint chip colors are the solid splotches of yellow, red, blue, green, etc — one splotch for each color chip in the picture of color chips. The oddly-shaped, multi-colored translucent blob surrounding the small color splotches represents the location and shape of the sRGB color space inside the CIELAB color space.
Let's take a close look at these paint chips in the CIELAB color space — it will be a wee bit tedious but quite informative:
The L axis and the a-b plane
See the white grids in Figure 1 above? Every color in CIELAB space has three coordinates, "L", "a", and "b". The white grids are the a and b CIELAB coordinates, which together make a two-dimensional plane. The picture on the left shows the a-b plane looking down at an angle from above and the picture on the right shows the a-b plane looking up at an angle from below. You can see the various paint chip colors floating in mid-air above the a-b plane.
Usually a and b run from -128 to +127. a runs from very yellow (+127) to very blue (-128). b runs from very magenta-red (+127) to very green (-128). To make it easier to remember which direction is which, positive numbers give you warm colors (yellow, magenta-red) and negative numbers give you cool colors (green, blue). And at the intersection (a=b=0), you get neutral gray.
The a-b coordinates tell you "what color" but not "how bright" the paint chips are. The third coordinate, "L", tells you "how bright". The L axis is the faint white line that sticks up at a right angle to the intersection of a and b on the a-b plane. L only takes positive values and runs from 0 to 100 (sometimes L gets scaled to run from 0 to 1, or to 255 or 65535).
The paint chip color locations in the CIELAB reference color space
If you squint at the view in Figure 1 on the right, you can see a splotch of white hugging the L axis.That splotch is the white background of the picture of the paint chips. As you might guess, the color given by the CIELAB coordinates L= 100, a=0, b=0 — usually written "(100,0,0)" — is pure white; (0,0,0) is solid black.
Look the yellow splotch in the view from above the a-b plane (left-side): that yellow splotch shows you the CIELAB location of the yellow paint chip. It has a relatively high L value (it's very bright). It has a reasonably high, positve a value (it's very yellow). Its b value is essentially 0 (it's a very pure yellow rather than an orangish or greenish yellow).
Now look at the green splotch in the view from below the a-b plane (right-side): The green splotch is a little higher than mid-way from 0 to 100 on the L axis: the green paint chip is a nice bright green, but not nearly as bright as the yellow paint chip. The green splotch has a negative b value (it's very green) and also a positive a (it's on the yellow side of green, a kelly green rather than a bluish green. (You can tell where on the a-b plane all the splotches are by looking down at the pictures in Section B, which don't show the L axis.)
Projections and very bright and dark colors
Before moving on to the next set of pictures, there are two more things to glean from the 3D views above:
First, see the color outlines on the a-b planes? Those outlines are projections (like shining a light down from above the a-b plane) of the three-dimensional sRGB color space onto the a-b plane. See the dark splotches on the a-b plane? Those are the projections of the paint chip color splotches hovering in mid-air above the a-b plane. In the following pictures those splotches are shown in color.
Second, notice that sRGB gets smaller across as L approaches 0 (solid black) and also as L approaches 100 (solid white). This is true of all RGB working color spaces and also true of human color perception in general — the closer to white and black you get, the fewer colors you can distinguish.
Six familiar color spaces inside the CIELAB reference space
The six pictures below show the paint chip colors inside variously sized and shaped color spaces that you work with every day in your digital darkroom: sRGB, a camera input profile, ProPhotoRGB, a monitor profile, a printer profile, and AdobeRGB. All of these color spaces are shown inside the CIELAB color space. The views are all two-dimensional projections onto the a-b plane, looking straight down from above the L-axis. You will see that regardless of which color space the paint chip colors are in, their location in CIELAB space is exactly the same.
Eight basic color management concepts
Reference color spaces: CIELAB and CIE XYZ
As you have seen, regardless of which color space the pictures of paint chips are in, regardless of how big or small that color space is, or how it is shaped, the location of the paint chip colors in CIELAB space remains the same. That is because CIELAB is a reference color space.
Every color that you can see out there in the real world, whether it's the color of a flower in your hand or the color of a flower displayed on your computer screen, has a single location inside a reference color space. Which means that if you specify a color by giving its reference color space coordinates, everyone else knows exactly what color you mean.
Reference color spaces are abstract, non-intuitive mathematical models. But these abstract models are ultimately based on human vision, on what real people really see when they look at different colors. The CIELAB reference space is mathematically derived from another reference color space, the very important 1931 CIE XYZ color space.
The 1931 CIE XYZ color space is mathematically derived from the results of laboratory experiments done in the 1920s, in which real live human beings matched up various color patches on a disc with color patches created by shining red, blue, and green lights on a second disc. Those experiments mapped out all the colors that you can see, out there in the world.
As an aside, there are actually several varieties of CIELAB space. The CIELAB space pictures on this page were generated with Cinepaint and Icc-Examin, which most likely use the 1976 CIELAB space.
Color space profiles
In addition to the reference color spaces, there are also color spaces that encompass particular subsets of all the colors that the average person can see. These "subset color spaces" (warning! those are scare quotes! "subset color space" is not official color management terminology!) are defined in terms of their positions inside a reference color space.
A color space profile describes and defines a particular "subset of all the colors" by giving enough information about that subset, such that any color within that particular subset of colors can be precisely located inside the reference color space. For example, the sRGB color space profile describes and defines the sRGB color space with reference to the XYZ color space, but because CIELAB is derived from XYZ, all the colors in the sRGB color space can also be located in the CIELAB color space.
As an aside, all the color spaces on this page are RGB color spaces. All the colors in an RGB color space are a combination of Red, Green, and Blue. In addition to the RGB color spaces, there are also CMYK color spaces, in which all the colors are a combination of Cyan, Magenta, Yellow, and blacK. You can convert an RGB image to a CMYK color space and back again; Dan Margulis' excellent books have tips on interesting things you can do with a CMYK editing space, even if you never intend to print your image with a CMYK printer.
RGB colors change depending on which RGB color space you are using
If you specify a color by giving its XYZ or CIELAB (often referred to as "LAB" for short) color space coordinates, everyone else knows exactly what color you mean. The same is not true if you specify a color by giving its RGB or CMYK coordinates, because a color specified by RGB or CMYK values is completely indeterminate until you also know which RGB or CMYK color space should be used to interpret these numbers.
For example, the RGB values (82,198,48) specify a particular shade of green for an 8-bit integer image. But which shade of green (82,198,48) actually represents is completely indeterminate until you also know which RGB color space should be used to interpret these RGB numbers:
As shown in the screenshots above, in a linear gamma version of the sRGB color space, the RGB values (82,198,48) represent a moderately bright, moderately saturated shade of green that is located in LAB space at the coordinates L=214, a=39, b=50. In a linear gamma version of the ProPhotoRGB color space, the same RGB values represents a moderately bright but considerably more saturated shade of green, located in LAB space at the coordinates L=214, a=70, b=58. Both shades of green fit comfortably inside the sRGB color space gamut (the multicolored blob in the above screenshots); but the ProPhotoRGB green represented by (82,198,48) is close to the edge of the sRGB color space gamut, and "greener shades of green" in the ProPhotoRGB color space would fall outside the sRGB color space gamut.
Matrix RGB color spaces
ProPhotoRGB and sRGB are examples of matrix RGB working space profiles. A matrix RGB color space is defined in terms of the location of its RGB primaries in the XYZ reference color space, which in turn determines its respective size (volume) and shape in the LAB reference color space.
A matrix RGB color space is also defined in terms of its Tone Response Curve ("TRC" for short). The TRC determines how fast a color gets brighter as its RGB coordinates progress from 0 to the usual maximum white value (255 for an 8-bit integer image, 65535 for a 16-bit integer image, and 1 for a floating point image), but doesn't have any affect on the size or shape of the RGB color space gamut.
A monitor profile tells your color-managed software what combination of Red, Green, and Blue is needed to display any given real world color on your monitor screen. There aren't any monitors that can display all the colors you can actually see, out there in the real world. So a monitor profile describes the particular subset of all possible real-world colors that the monitor can actually display.
Camera input profiles
If you work with raw files you need a camera input profile. A camera input profile tells your raw rendering software how to interpret the RGB numbers in the image file produced from your raw file.
Working space profiles
A working space is a special kind of color space that is suitable for editing your images because it is well-behaved. There are (at least) two criteria for a well-behaved color space:
- if R=G=B, the resulting color is gray.
- if R=G=B=255, the corresponding CIELAB color is (100,0,0) (with L* running from 0 to 100).
sRGB, AdobeRGB, and ProPhotoRGB are examples of well-behaved working color spaces. Color spaces defined by camera input profiles, printer profiles, and monitor profiles typically are not well-behaved.
Color gamut is just a short-hand way of referring to any given subset of all the colors that the average person can see, out there in the real world. Examples of color gamuts include: all the colors in the sRGB color space, or all the colors in a particular image, or all the colors that a particular printer/profile/ink/paper combination can print.
As you can see by glancing at the pictures on this page, different color spaces have very differently sized and shaped color gamuts. The color gamut of a camera input profile is humongous, the color gamut of ProPhotoRGB is merely huge, and the color gamut of sRGB is quite small.
The very small color gamut of the picture of paint chips fits nicely into all of the color spaces on this page. If I had brightened the image during raw processing, the yellows would have been driven right outside the sRGB color space, but would still have fit comfortably inside the ProPhotoRGB color space.
Mismatched color gamuts and out of gamut colors
Mismatched color gamuts just means there are colors contained within one color space's color gamut, that are not contained in the other color space's color gamut (and possibly vice-versa). Out of gamut colors become a problem when you want to convert an image from one color space to another. The yellows that would have been produced if I had brightened the paint chip picture during raw processing and that would fit comfortably inside the ProPhotoRGB color space, would have been out of gamut with respect to the sRGB color space.
What to do with out of gamut colors when converting from one color space to another is outside the scope of this article, but the process is called soft proofing.
More about the CIELAB color space
Why bother with CIELAB? because CIELAB is perceptually uniform
Why bother with CIELAB when it is derived from XYZ? Why not just use XYZ?
From a theoretical perspective, the problem with XYZ is that it isn't "perceptually uniform": a one-unit change in color, followed by a second change of the same size, isn't perceived by human observers as producing equal amounts of color change. So just about as soon as the XYZ color space was created, color scientists set about mathematically deriving a reference space that is more perceptually uniform.
From a practical perspective, some of the high-powered image processing programs that you probably already use allow you (and sometimes force you, but then they do it behind the scenes) to edit your image in LAB space as well as in regular RGB working spaces such as sRGB or ProPhotoRGB. So it's nice to have a working picture in your mind of what happens when your image is converted in and out of LAB space. (The only software that I'm aware of that allows editing in XYZ space is Cinepaint.)
Can CIELAB hold all the colors you can see?
You might think, given that CIELAB is a reference color space, that any color that you can see out there in the real world, can be represented in CIELAB. Theoretically, yes. In practice, in your imaging software, often no.
Why not? Remember I told you that a and b usually run from -128 to 127? Well, whenever you see numbers like 8, 16, 32, 64, 128, and 256 (powers of 2), you are seeing numbers that are convenient for computers. What's convenient for computers doesn't always accomodate what's "really real" for humans.
There are real colors that humans can really see, that have CIELAB a and b values that are less than -128 and/or greater than +127. Some of those colors are in fact capturable by your camera and can be held inside the very large ProPhotoRGB color space. But when your editing program sends your image to CIELAB for processing, often those colors are clipped. Going back to ProPhotoRGB or to the color space defined by your camera input profile doesn't magically retrieve the lost colors. They are gone for good.
Unless, of course, your imaging software allows larger a and b values.
I don't know of any imaging software that allows a and b values outside the usual -128 through +127 range. Update: Since version 2, LittleCMS does not clip during ICC profile conversions to CIELAB and back, assuming certain easily met preconditions are met by the ICC profile's Tone Reproduction Curves. So whether your editing application clips upon conversion to CIELAB depends upon the image's ICC profile and also upon what Color Management System you are using. If you run Linux, almost all free/libre editing applications use LittleCMS for ICC profile conversions. If you run Windows or Mac, the CMS that's used depends on the particular editing application. PhotoShop, for example, doesn't use LittleCMS.
For more information about and some fantastic pictures (some of them interactive) of CIELAB space, please visit Bruce Lindbloom's website. He has a wonderful picture of the colors that ProPhotoRGB holds, that are often clipped upon conversion to CIELAB. Also see his page on RGB Working Space Information, which has:
- many more color space gamut projections onto LAB space than I show you here (albeit lacking the paint chip colors inside).
- an amazing 3D Gamut Viewer that lets you pick working spaces and see what they look like inside several different reference color spaces (XYZ and CIELAB are not the only reference color spaces that the color scientists have created). Unfortunately, the gamut viewer doesn't work with open source flash. So if you are using Firefox on Linux, you'll need to install the latest Adobe flash.
My article, Color science and the ICC profile specifications, talks about some of the history behind the 1931 CIE XYZ color space.