skip to main content

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.

3D views of the paint chip colors in CIELAB space, surrounded by the sRGB color space. The left-side view shows the view from above the a-b plane (the white grid). The right-side view shows the view from below the a-b plane.

If you squint at the left-side view, you can see that the yellow paint chip dots are trying to bust through the side of the sRGB color space. Digitally enhancing the picture to make the paint chips look brighter (more like they are in reality), would have driven some of the colors — especially the yellow, outside the very small sRGB color gamut.

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.

Paint chips in the sRGB color space.

See the yellow splotch that reaches the very edge of the sRGB color space? And the white splotch near the center? This is just what you were looking at in the previous pictures, except now you are looking at the 2D-projection onto the a-b plane.

sRGB (above) is an odd color space. It is frequently used as a monitor profile and also as a printer profile, but it is also a well behaved working space. sRGB is one of the smallest commonly-used color spaces (AppleRGB is slightly smaller).

Paint chips in "camera space" (really, in the color space defined by a camera input profile).

As the paint-chip image started out as a raw file, the first color space it encountered was the color space defined by a camera input profile. The camera input space above is really big — much bigger than sRGB — and it has a funny shape. It actually goes way off the edges of the a-b grid, with a "green wing" angling upward and outward from the upper left corner, and a "magenta-red wing" angling downward and outward from the lower right corner.

On the one hand, the colors in the "wings" are imaginary colors, meaning they don't correspond to any actual colors you can see out there in the real world. On the other hand, there are colors out there in the real world that this camera-and-input-profile combination can't capture. In particular it misses the most saturated real-world reds and also the most saturated real-world greens and blue-greens.

The paint chip picture can be converted from the color space defined by the camera input profile straight to sRGB without losing any colors that were captured by the camera. For many real-world photograhs, this is not the case. If your photograph has very saturated bright or dark colors, especially yellows, greens, and reds, you might want to choose an output/working space that is bigger than sRGB. As a general rule of thumb, the brighter and more saturated a color is, the less likely it will fit into the sRGB color space; also the darker and more saturated a color is, the less likely it will fit into the sRGB color space. A very bright saturated red won't fit; a rich dark wine or burgandy color also probably won't fit (depending on how saturated it is); reasonably bright pastels and medium-bright, not-too-saturated colors will fit quite nicely.

Paint chips in the ProPhotoRGB color space.

ProPhotoRGB (above) is the largest commonly used image editing space. ProPhotoRGB looks (and is) smaller than the camera space pictured above. But ProPhotoRGB has (i)far fewer imaginary colors and (ii)more real-world greens and blue-greens, but still not all the real-world greens and blues. The camera input profile does pick up a few real-world blues and violet-blues that ProPhotoRGB misses. So if the paint-chip image above had contained any of these real-world blues that ProPhotoRGB can't contain (it doesn't), those real-world blues would have been lost (discarded) upon conversion from the camera input space to ProPhotoRGB.

Unlike sRGB, ProPhotoRGB is generally regarded as "too big" to be used for editing 8-bit images. To see why, locate each color space's respective green-yellow outer edges, in the upper left corners of CIELAB space. Now locate their respective magenta-blue edges, down in the lower right corners of CIELAB space.

Now consider: In a 16-bit image, you have 65535 increments to get from the upper-right edge to the lower-left edge of a color space. In an 8-bit image, you only have 256 increments to get from the upper-right edge to the lower-left edge. Those 256 increments are spread far enough apart in the ProPhotoRGB color space, that even with minor editing you can easily cause posterization in your image, which means visible jumps from one color to the next in areas that ought to have smooth, continuous color transitions.

Paint chips in "monitor space" (really the color space defined by the monitor profile).

This color space profile is the monitor profile for an LCD monitor profile. Every monitor is different. The color space defined by this LCD monitor profile (which happens to be my own monitor profile) is a little bit bigger and a slightly different shape than the sRGB color space (sRGB doesn't make a very good monitor profile for today's LCD monitors). However, it is still much, much smaller than either the camera input space or ProPhotoRGB. When you use ProPhotoRGB as your working space, you run the very real risk of producing colors you can't see on your monitor. Which of itself is perfectly acceptable, if you know what you are doing.

Paint chips in "printer space" (really the color space defined by a printer profile).

This is the color space defined by a Chromira printer profile. This Chromira Printer profile looks small even compared to sRGB, but it can print yellows, greens, and blue-greens that are outside the sRGB color gamut. There are a lot of images that come out of your camera with yellows (and greens and blue-greens) that can be printed (depending on your printer), if only you don't throw them away by converting your raw files directly to sRGB.

Paint chips in the AdobeRGB color space.

AdobeRGB was proposed (or, so they say, accidentally invented and then adopted) precisely as a working color space that holds more greens, blue-greens, and yellows than the sRGB color space, to hold colors that can be printed, that are outside the sRGB color space. Many other color spaces have been proposed as compromises between the extremely large ProPhotoRGB and the extremely small sRGB — BruceRGB, BestRGB, and BetaRGB, to name three.

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:

Two different shades of green as seen from inside the LAB reference color space.

Left: top view looking down the L axis; Right: side view looking along the -b axis of the a-b plane. The green dot that is farthest from the L axis is the color green represented by the RGB values (82,198,48) in a linear gamma version of the ProPhotoRGB color space. The green dot closest to the L axis is the color green represented by the RGB values (82,198,48) in a linear gamma version of the sRGB color space.

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.

Monitor profiles

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:

  1. if R=G=B, the resulting color is gray.
  2. 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

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.