.
Digital-Image Color Spaces, Page 1: Introduction
Article: Table of Contents       Page: 1 · 2 · 3 · 4 · 5 · 6 · 7       This is the first page of a seven-page article

Prolog

There are multiple ways to interpret a number as a speed: “65” in miles/hour is highway cruising speed, but “65” in knots is a speeding ticket, while “65” in kilometers/hour is only half that speed. “65” in meters/second is a category-4 hurricane, and “65” in Mach is faster than a meteor.

Clearly, when discussing speed, it's important to know not only the raw number, but also the scale to apply to it.

Introduction

When it comes to representing color, the digital-image version of this kind of scale is its color space. A digital-image file is made up of raw numeric data — data that is not “color,” but numbers representing color. There are actually many different ways to represent color with numbers in an image file; if an application processing an image file doesn't know which scale was used in creating the image's raw numeric color data (and if it isn't able to guess correctly), it doesn't know how to properly recreate the color when printing or displaying the image. The result is an image with wrong colors, like a TV whose “tint” setting is way out of wack.

Here's an example (me and my son, neither of whom are supposed to be green!):

image whose color space is recognized and understood

Color Data Properly Interpreted

image created with a crazy color space, but without an embedded color pfoile, so it looks wonky

Color Data Misinterpreted

So, a color space is a set of parameters that describe how to convert between numbers and real-world colors. Different color spaces mean different conversions: different real-world colors from the same number, or different numbers from the same real-world color. The technical details are discussed later in the article; for the moment, just consider them abstractly.

File Formats are an Unrelated Topic

To be clear, the concept of a color space is different from a file format. Many image file formats (such as JPEG, TIFF, DNG, etc.) have the ability to use different color spaces — different ways to encode the image color — for their raw numeric data. You can think of a file format as being a standard for how to arrange image data (“such-and-such metadata is allowed, the image is composed of lines of pixels arranged this-and-that way, using such-and-such compression and interleaving....”) and a color space describes how to interpret the per-pixel data into light.

Using music files as an analogy, the “sound space” would be a set of parameters such as the minimum and maximum frequency that can be encoded, the range of amplitudes (volume) that can be encoded, and the mathematical parameters for how the smooth range of encodable real-world frequencies and amplitudes are converted to discrete, raw numeric data.

Color-Space Basics: “sRGB”

The most commonly-used color space is called “sRGB,” which has one overwhelmingly important characteristic: it's the most commonly-used color space. Just about every scanner and digital camera can produce images with sRGB-encoded color. Just about every image-handling device (like printer) and color-aware application (photo editor) can handle images with sRGB-encoded color. In fact, it's the de facto default color space for image input and output of most devices and applications (at least those that understand color spaces). It's the official default color space for the World Wide Web.

The ubiquity of the sRGB color space is really quite convenient.

Because things that produce images (digital cameras, scanners, image-editing software, ....) are on the same color-space wavelength, so to speak, as many things that process or display images (printers, image-viewing software, ...), colors are generally encoded and decoded reasonably well. What you see is not only what you get, but what you're supposed to get.

So, in the face of this overwhelming ubiquity, why would anyone even bother using a different color space for a digital image? (That is, a different method to encode colors with numbers within the raw image data?)

Color-Space Tradeoffs

For technical reasons discussed later in this article, the design of a color space necessarily involves tradeoffs among various aspects of image quality. For example, it might be surprising to learn that it's impossible for a color space to represent all the colors that a human eye can discern, and so some subtle shades must necessarily be omitted (if an image's true color is one of the omitted shades, the encoded color becomes one that's close — usually very, very close — to the true color). So, which shades are included and excluded is one aspect that makes a color space more or less appealing to certain users or artistic tastes.

The next page of this article offers a few more technical details about color spaces and their relative merits, but the main point of this article is merely to introduce the concept of color spaces — ways to convert colors to and from raw numeric data — and why it's important for the photographer to know about them.

Color Profiles

When a different color space is used to encode the raw image data, the resulting data is still just a bunch of raw numbers, so how does a printer or application know that it should consider it in the light of something other than sRGB (or whatever its default color space is)? The answer is usually found in the form of an embedded color profile.

A color profile for a color space is the aforementioned set of parameters that describe the color space, arranged in a standardized way so that they can be communicated along with an image. It can be embedded within a digital image file as metadata, along the same lines as how the date and time are included with the image. This conveniently allows a printer, image-display software, or other color-aware device/application that receives the image file to know the particulars of the color space so that it can properly decode the colors. (If an image doesn't have an embedded color profile, most devices go ahead and decode the colors using the parameters of the sRGB color-space.)

Without the proper color profile associated with the color space used to create the image data, applications don't know how to decode the color data. This results in mixed up or “off” colors, like the “color data misinterpreted” image shown above. That example, by the way, is not a simulation, but an image that looks perfectly normal when interpreted using the proper color space. To ensure that you'd see the wrong colors, I manually removed the embedded color profile from the image file, knowing that your browser would then misinterpret the color data.

Color Profiles Don't Always Get The Respect They Deserve

You might be surprised to find out what happens when I do go ahead and include the proper color profile along with the image, as I do with the middle image here:

image whose color space is recognized and understood
Correct
image with crazy color space, and an embedded color
profile to match
Correct or Wrong?
image created with a crazy color space, but without an embedded color
pfoile, so it looks wonky
Wrong
(For your reference, here is the color profile for the color space used for the center and right-side images.)

Does the middle image look okay or wrong? It depends on how colormetrically-enlightened your browser is:

  • Middle Image Looks Okay: your browser recognizes and respects an image's embedded color profile. Congratulations!

  • Middle Image Looks Wrong: your browser does not recognize or respect an image's embedded color profile. How unsociable!

And herein lies the problem: most browsers are not “color managed” applications, meaning that they do not know how to recognize or understand color profiles.

We'll talk much more about color management later, but first let's look at just how wrong the colors can be in a real-world situation. When creating the sample images shown above, I purposefully used a color space wildly different from sRGB — one that I made up just for this purpose — so that the “wrongness” would be exaggerated and obviously apparent at first glance.

The next page of this article shows a variety of photos encoded with real-world color spaces (color spaces named AdobeRGB, ColorMatch, ProPhoto, WideRGB, and AppleRGB) but without an embedded profile, allowing you to see real-world effects of misinterpreted color.

Continued on the Next Page

This article continues on Page 2: Test Images.


Comments so far....

i got to your article through a link at dpreview forum
article is very clear, thank you. greets from italy
augusto

— comment by augusto on October 22nd, 2006 at 12:53am JST (2 years, 1 month ago) comment permalink

This article is by far the best explanation of these issues I’ve seen on the web. Saves me from having to write one up myself. Thanks!

— comment by Jacob Rus on October 22nd, 2006 at 6:28pm JST (2 years, 1 month ago) comment permalink

Great article Jeffrey, thanks for the clear, detailed explanation… This has actually helped me solve a display problem with a digital camera project I am working on.

— comment by geometrikal on November 20th, 2006 at 11:46am JST (2 years, 0 months ago) comment permalink

Thanks for your great article. I don’t remember ever reading a better one on the subject. Your article is very informative *and* accurate! Many people write so much rubbish about color spaces, and don’t even sense their own misunderstanding of the subject!

— comment by David on January 19th, 2007 at 2:22pm JST (1 year, 10 months ago) comment permalink

This is an excellent read. I’m dealing with multiple browsers and platforms that are calibrated yet I couldn’t get my images to look ‘right’ in non managed applications. I think I’m starting to understand.

Well done!!!

— comment by Scott Watters on February 1st, 2007 at 7:25am JST (1 year, 10 months ago) comment permalink

Examples at
http://regex.info/blog/photo-tech/color-spaces-page2/
are impressive. I didn’t know color spaces are SO different.

A small comment -
“65” in kilometers/hour is only half that speed - a kilometer is a little bit bigger.
Your visitors from Europe can be disappointed.

“Suggestions for Online Image Hosting Services” - I need to ask more questions. What is the best way to do that?

— comment by FP Images on February 21st, 2007 at 9:29am JST (1 year, 9 months ago) comment permalink

Extremely informative article, well reserched and clearly presented. I for one am thankful Jeffery took the time to share his expertise. This explains many of my color space, camera and printing questions.

— comment by Arthur Emerson on February 26th, 2007 at 1:37am JST (1 year, 9 months ago) comment permalink

Thanks,
I was pointed to your article when I was venting about how I couldn’t get my pictures to look good on the web. :) Very helpful!

— comment by Rob on April 10th, 2007 at 10:34pm JST (1 year, 8 months ago) comment permalink

“Without the proper color profile associated with the color space used to create the image data, applications don’t know how to decode the color data.”

I never include a color profile with files I send out for printing. I’ve been advised by the printing service NOT to embed a color profile. The results I get are excellent.

Embedding a color profile is only one way to associate the proper profile with an image. Other methods include notating the color space in the Exif metadata (digital cameras do this), or by mutual agreement as you and your printing service are apparently doing. I would suspect that you’re sending them sRGB and that they’re expecting sRGB. Try converting a copy of an image to, say, ProPhoto and have them print it, and I’m sure you’ll see a huge difference due to the color-space mismatch when you get it printed. —Jeffrey

— comment by Anonymous on June 26th, 2007 at 7:07am JST (1 year, 5 months ago) comment permalink

Excellently written explanation, clarifies a lot of issues -thanks !

FYI you are referenced in this Flickr stream too (though I’m sure the G machine keeps track)
http://www.flickr.com/photos/jurvetson/2049038298

Cheerios
nycandre

— comment by NYC.andre on December 10th, 2007 at 9:48pm JST (12 months ago) comment permalink

Wow! Thanks for the tip… I’m now using Apples’s Safari browser.

— comment by Mike on December 22nd, 2007 at 2:12pm JST (11 months ago) comment permalink

It’s people like you who make small sections of the net worthwhile and informative when visiting… welcome to my bookmarks!

— comment by Bryant on March 27th, 2008 at 2:59am JST (8 months ago) comment permalink

Excellent material — I think I’m finally beginning to understand this stuff. Some related questions:
1) I’ve noticed that Lightroom 2.0 recommends that images are edited in Photoshop with ProPhoto RGB due to its larger gamut. I have my WorkSpace set at AdobeRGB (and I convert to sRGB for saving to Flickr with your excellent plugin - thanks!), and was wondering what the relative pros/cons are about setting my WorkSpace to ProPhotoRGB?
2) When your Lightroom 2.0 plugin exports to Flickr, I am assuming that it embeds the requested sRGB profile in the file — is that assumption correct?
and finally,
3) I have an xRite i1 colorimeter for my LCD monitor. For a while I used to set my Adobe Creative Suite WorkSpace to the i1 generated profile. But I’m now thinking that this is incorrect. I should be setting my WorkSpace to AdobeRGB or ProPhotoRGB, and the colorimeter automatically only affects my monitor profile so that it can correctly interpret the files I am using with Photoshop, Lightroom, etc. Is that right?

Thanks so much for your excellent writing and work.
Nick

— comment by NickP on August 4th, 2008 at 3:41am JST (4 months ago) comment permalink

Great article. I didn’t realize it was so complicated.

— comment by coloring pages on September 11th, 2008 at 3:15am JST (2 months ago) comment permalink
Leave a comment...

More or less plain text — see below for allowed markup

You can use the following tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>