Color management

Dave Neary skriver i sin blog:

With the recent GIMP 2.3.3 release, color management in the GIMP is now well past what we have had before. Recently, someone asked me what color management is, in simple terms, so I wrote the following. There might be some error in here, unfortunately I don't always have the time to research what I write. Corrections welcome.

Color is one of the most subjective things around - what are "red", "green", and "blue" quantitavely? Every input device has a slightly different perception of color - try scanning a photo with 2 different scanners, or taking a photo of the same scene with 2 different cameras. The results will be almost, but not quite, the same.

There are similar problems for output - two screens will show the same data with slightly different colors, and the same image printed to 2 different printers may be different.

Usually, the differences are small enough that we don't really care (although if you do the test, you might be surprised at how big the difference is). But for print work and graphics design, color is everything. We want to start from a photograph, have colors from the photo appear exactly the same on the screen, and then after airbrushing away those freckles and printing the photo, we want the colors to look the same as the original.

Company logos and art-work are chosen with their colors by meticulous people who couldn't tolerate a slightly different shade of pink being in the logo than the one they chose - imagine a graphics designer ripping his hair out while passing a billboard add saying "No, no, they ruined my work." because the charcoal grey he had chosen was slightly darker than the printed result.

So to address all these issues, an international standards body was established, to decide what color is. In fact, there are two groups - the first, the CIE (Commission Internationale de l'Eclairage) defined the standard for colorspaces, and the ICC (International Color Consortium) defined a standard way to convert between these standard colorspaces and device-specific colorspaces. The CIE colorspaces are XYZ for linear additive color (plates in a printer, or diodes on a screen, for example) and La*b* for "perceptive" color - which doesn't quite work the same way. So a value in one of these colorspaces is the same, everywhere.

They also defined a means of converting from these standards to other colorspaces. Our typical RGB colorspace represents the way light waves combine to create color. CMYK, for cyan, magenta, yellow, blacK, is the way that paints mix to generate colors (since paints absorb rather than reflect colors, this is called a subtractive colorspace - as you know if you've ever painted, when you add more & more paint to a mix, the color gets darker & darker, until every addition just gives a murky brown).

The means to changing between colorspaces is a color profile (also called an ICC profile). These can be embedded in images to say what colorspace was used to capture the data, to allow it to be converted to XYZ, and from there to another colorspace.

High-end scanners and digital cameras embed these profiles in the images that come from them. Screens and printers have profiles associated with them too. So we can load an image, and by applying the embedded profile, in combination with the display's profile, the projection on the screen should be exactly the same as what we started with. And by combining with the printer's profile during printing, the result on paper will look the same too.

This functionality has long been missing from the GIMP, but now we have it. Admittedly, it is of limited usefulness while we are limited to 8 bits per channel, because the application of a color profile results in what is called banding - when you squeeze one colorspace into another, sometimes colors close together map to the same color in the output, which means that we lose some quality. However, this is a massive step forward over what we have had until now.