Ask Dr. Color’s Assistant – Colorspaces

Dr. Color’s assistant here. Here’s a recent question from the good doctor’s answering service that will be of interest to photographers.

Hi, Dr. Color? What colorspace should I use with my new digital camera? What is a colorspace anyway?

A colorspace is the set of all possible colors that can be represented by a set of values, usually (R,G,B) triples, but also L*a*b* and CMYK and XYZ and so on. This collection of colors is known as the gamut.

(You might be questioning the possibility of the same RGB value — say (255,128,128) — looking different on two different devices. Trust me, friends, it’s true. If you don’t believe me, fiddle with the buttons on the front of your monitor and watch the colors change.

Three things influence the gamut of a colorspace:

  • The color of the red, green, and blue primaries
  • The color of “white”
  • The bit-depth of the image

We’ll look at each of these in turn.

RGB has three primaries: red, green, and blue. Changing the color of any of those primaries — either by fiddling with the buttons on your monitor or by changing the values in your color calculations — changes the color of every other (R,G,B) triple in your colorspace, creating a new colorspace. The easiest way to visualize this is via a chromaticity diagram, which shows all of the visible colors (for a given luminosity).

The sRGB colorspace (from Wikipedia)

The three corners on the triangle on the chromaticity diagram are the colors of the red, green, and blue primaries. Notice that the primaries don’t actually extend to the corners of the chromaticity diagram for this colorspace. Colors outside the triangle can’t be represented by (R,G,B) numbers. The primaries determine the size of the gamut.

The chromaticity diagram above only shows one slice through the gamut, corresponding to a particular level of luminosity (roughly equivalent to lightness). The actual gamut is all of the slices for the various luminosity values. The brightest white and its color provide another axis through the colorspace. (It’s actually true that there are different colors of white: daylight white, flourescent white, tungsten white, and so on.)

To get technical for a moment, the primaries determine the span of the linear combination of the primary colors; while the whitepoint determines the weights for the linear combinations. Together they determine where a particular (R,G,B) triple will fall on the chromaticity diagram, which is in device-independent xyY (or xyL) space.

Finally, the bit-depth of the image determines the spacing between the colors. Because the individual red, green, and blue components must take discrete values (e.g., 1, 2, 37, and so on) there are gaps between neighboring colors. Bit-depth is the range between the minimum and maximum values for each color channel. An 8-bit image has R, G, and B values that vary between 0 and 255. For 16-bit images, these values range from 0 to 65,535.

Obviously, if you edit an image in a higher bit-depth mode, you can either (1) pack more colors together or (2) expand the colorspace to include more colors. Actually you can do both. Conversely, if you choose a very wide colorspace but a low bit-depth, your image will have banding where neighboring pixels show unpleasant jumps in color. For example, it’s generally unwise to edit an 8-bit image in the very wide ProPhoto RGB colorspace.

So what colorspace should you pick?

First off, don’t pick sRGB for editing. As you can see in the diagram above, the colorspace is rather small. It’s really only good for preparing images for the web.

If you’re storing your RAW images for later processing, consider ProPhoto RGB. It’s very wide, but you should only edit in 16-bit mode.

A nice compromise is Adobe RGB (1998). It’s much wider than sRGB but not as big as ProPhoto RGB; yet it’s still possible to edit in 8-bit mode without too many problems.

Of course, you will use different colorspaces when printing and displaying images, but you shouldn’t use these for editing or storing images: The gamut of your monitor or printer is almost always smaller than a good editing space. Often sRGB is smaller than these gamuts, highlighting why it’s such a bad idea to use it for editing.

This entry was posted in Color and Vision, Fodder for Techno-weenies, Photography. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>