Sunday, October 03, 2010

Color management

This article is a work in progress, I'll add stuff as I learn

I'm trying to get my head around color management. I own a Nikon D90 and I publish my pictures on Flickr.com. In between, there's a macbook pro with led screen that I use to edit my pictures with. So there's 3 devices (camera, laptop and the screen of the visitor to flickr) with all their variables to manage. I want to be able to take a picture, edit it and make it look natural and correct on most screens.

Between each 2 devices, there is a resulting picture. I think that it's important to make sure that the resulting picture is as 'perfect' as can be in regards to the color and light distribution.

Let's first look at the variables.

White balance
This is the color temperature, or the color that is used to display 'white'. It's expressed in Kelvin (K) or by standard (D50, D65). Some well known values are:
  • 1850K
  • Candle flame
  • +/- 2700K
  • Light bulb
  • 5000K / D50
  • Horizon daylight
  • 6500K / D65
  • Daylight

Now for the devices.

The camera
A camera doesn't see colors, it has to guess them. If the cameras white balance is set to auto, it does this by looking at the average color and defining that as 18% gray. If you use a preset, you are telling the camera what temperature 18% gray has. A third, and most exact, option is to photograph an 18% gray card and telling the camera to store that as a preset (custom white balance). Note that the 18% might be 12% or 13% with some cameras as read here.
So what happens if you make a picture where the average isn't 18% gray? The white balance will be off and the colors wrong. Think about orange street lights for example, or snow. These things change the average a lot and cause wrong colors.

So what to do? Best is to take a gray card with you and make pictures of it before every change of scene or light, but which amateur does that? Hence the need to post-process images...
This isn't a very difficult thing to handle though.. as it's one single white point you have to change, the rest of the colors slide with it. Many software programs can help you here, for example by letting you set a specific part of the image (like a gray wall) as average gray.

Another issue with a graphics device is the sensitivity for each color. This is never 'straight'. A camera might, for example, be more sensitive to red and thus assigning higher values to this channel.
To solve this, or better: adjust to this, color profiles exist. Each camera/lens combination has it's own little abnormalities which can be described in a color profile. This profile is then used by the post-processing or conversion (in case of RAW) software to adjust them. You can easily make such a profile yourself by photographing a standardized color chart and using software like argyllCMS to build a profile from it.

Last part is the color space used. This defines what the values that are recorded actually mean. In other words, how red is 50% red? The most popular color space is sRGB, this is what all browsers use as well. Some browsers are capable of reading a color space definition that is packed with an image (some firefox versions, chrome, Safari). But best is to not trust that and go for the standard sRGB. Adobe has a derived definition, AdobeRGB which allows for brighter colors. When a picture using this definition is viewed on, for example, Internet Explorer, it looks flat due to the mismatch with the assumed (by IE) sRGB.

So now we have a picture that has correct white balance set (or a least a way to fix it) and with the color values calibrated and defined. On to the next stage...

Post-processing
Most important to start with is to make sure we don't change the color space or white balance (color temperature) due to wrong settings. It's ok if you want to change either of them, as long as you do it on purpose. If you edit in a different color space for example, you will be bound to work in the space that's available in both. So if you photograph in a space with bright colors but edit in one with less bright colors, you loose the bright colors but ALSO the dark ones as they were not defined in both.

Then, if you want to change the colors or light levels, you need to make sure that what you see on the screen is correct.
First of all the color temperature. A computer with a screen is somewhat the reverse of a camera. The computer doesn't know by default what white balance the screen has. CRTs for example have a color temperature of around 9300K, while most laptop screens have below 5000K. A 5000K screen viewed with 6500K set looks reddish for example.
Second, there are sensitivity issues as well, a screen never displays the same brightness for each color at the same value, just like a camera is capable of capturing each color with the same brightness into the same values.
In order to adjust for these issues, we need to profile and calibrate. The profiling will tell you what color temperature your screen has, so that you can choose one that's close and use that in your software and calibrate for it as well. The calibration will display patches of colors on the screen to be measured in order to see the differences in color level. All this is then stored into a color profile (.cal) file.
When loaded into the operating system, and with the color temperature set in the editing software if applicable, you can be sure that what you see is what you get.

Of course on this level we have color definitions as well, so be sure to use the same one you chose before, in your camera.

A computer screen also needs a gamma setting. This is the graph that defines how a screen goes from dark to bright (which is never just linear). I find it best to get the value from my profiling software and feed it to the calibration software. That way I'm sure I see the correct distribution of light within a specific contrast.