Calibration Basics


THE DIGITAL CORNER  

I had hoped to present a reasonable summary of the calibration process this month, but find it to be too big a project to handle all at once, especially with my current work schedule.  So let's begin with just an overview of the basics.

Calibration in the context of digital photography generally means setting things up so that the final output (in whatever form that might be) will look the way you intend.  A parallel, if not similar, process is or should be used in conventional photography as well, and this has been described in one or more club meetings.  This process makes it possible to switch from one type of film to another without having to make extensive tests each time.  Likewise, when you take film to a commercial processor for printing, they (hopefully) use calibrated processes to produce prints that are very close to the correct color and value scale.  One of the biggest problems in getting good digital images is that most people don't understand the calibration process for either domain, and are further confused by the differences and limitations of digital imaging.

One can think of the calibration problem as having a "color" part and a "value" part.  Value is easier to understand, but is more commonly the problem.  If we deal only in black & white images (actually "greyscale" images in the digital world), we need be concerned only with value.  Our original image has a certain density range (which expresses the ratio of lightest to darkest regions) and a "transfer function", which describes (via a graphed curve) how the density relates to linear values of light.  Ideally, this transfer function would be a straight line and the ratio of lightest to darkest regions would be enormous, so that every exposure would produce an image with detail information in every part of the image.  This is not the case, of course.  Film typically provides a fairly straight-line transfer function over a good range of light values, and gradually becomes "flat" at either end of the scale.  We already live with this limitation of film and know how to deal with it.

In the digital world "values" are expressed by numbers, and within a given digital system the range of these numbers is limited to a specific set, usually 0 to 255.  This range corresponds to the range of numbers that can be expressed with 8 bits (1 byte), which is a very fundamental data unit.  It can also be argued that this range is appropriate because humans can (generally) distinguish less than 256 separate values.  But this assumes that you have selected a suitable set of 256 values, having an optimal range and transfer function.  When an image is scanned the exposure and transfer function of the scanner must be matched to the density and transfer function of the film in order to capture an optimal image.  To understand transfer function better we can describe it with three more common terms:  Brightness, Contrast, and "Gamma".  Gamma is a new term to some people, and is used somewhat differently in different technology worlds.  What I mean by "gamma" is an exponential curve from black to white (a "bow" that can be either above or below a straight line from black to white).  Contrast is the slope (steepness) of the curve at the center.  The more vertical the line is, the more contrast.  Brightness (although this is a poor term for it) is the "base" level - the level of the darkest part of the image.  Refer to the graphs and sample images on the next page.

Gamma is particularly troublesome because people are not familiar with the concept and mistake it for contrast and/or brightness.  Non-linear gamma is often an inherent limitation of a given imaging technology.  Various digital imaging devices have different gammas.  A color monitor typically has a gamma of 1.8, which is pretty seriously non-linear (linear would be a gamma of 1).  One of the first steps in calibrating a digital imaging system is to compensate for the gamma of the monitor.  This can be done reasonably well by comparing a mid-range value with the average value of a tight pattern of blacks and whites and adjusting a transfer function to make them equal.

That makes the display more or less linear, but do we want the image data itself to be linear?  In an ideal world, yes.  But in the real world we have to consider the gamma of the ultimate output device.  We could keep image data in a linear form and then adjust it for a given output device just before sending to that device.  This may be necessary if the image will go to many devices or if we don't know what device it will go to, but remember that we have only 256 levels to work with:  Each time we adjust the transfer function some levels are lost, which results in a loss of detail.  The more severe a gamma correction, the more levels are lost.  So ideal output is achieved when the image is scanned and maintained in the gamma "domain" of the intended output device.  This gamma is then compensated for in the computer display system (in addition to compensation for the monitor itself), so that we still see a linear output more-or-less representing what the final output will be like.  If the output device has a severe gamma (and depending on how it relates to the monitor gamma), the display may show some contouring or loss of detail, but this is usually not a problem and is better, in any case, than having such problems in the final output.

After the value scale is properly adjusted we can consider color.  Except for the real world, color images are almost always expressed using a "tri-stimulus" model, meaning that the color at a given point is represented by the intensity of three specific frequencies (hues) of light.  A color monitor uses the Red/Green/Blue set of primary colors, while printing processes usually use the Cyan/Magenta/Yellow primaries.  Essentially, three colors are chosen to cover as broad a range as possible.  If the three hues are marked on a chromaticity chart the triangle defined by these points contains all the colors that can be created by various combinations of the three primaries.  It's important to note here that it makes a difference what the precise hue of the primaries is.  For example, if I scan a color photograph the scanner separates the red, green, and blue using its built-in filters.  When I display the image on a color monitor the colors are roughly the same, but each channel of image data stimulates color phosphors on the face of the monitor and the hue of the light emitted depends solely on the properties of that phosphor.  If only one phosphor color doesn't match the corresponding filter the entire color space is skewed.  If the hue difference is small most color points will still be within the triangle and thus representable (particularly since "real world" images tend to have very few highly saturated colors).  But mapping the input to the output requires more than adjusting the relative levels of the primaries.  Such a skew (or rotation) of the color space can only be corrected by mathematically "rotating" the color data.  This is done via a matrix multiplication:  An input set [R,G,B] is multiplied by a calculated 3 by 3 matrix to produce the output set [R',G',B'].

The same mathematical rotation (with more extreme coefficients) can be used to transform an RGB image into a CMY image.  Obviously, the overlap between these two triangles is not good at all, with a great many of the more saturated colors becoming impossible to reproduce.  As with the value scale, we must know the color space of the output device to reasonably preview what the image will look like.  Fortunately, CMY output devices tend to have smaller color spaces than RGB, so relatively few colors in the final output cannot be displayed on a color monitor.  However, a good deal of the RGB color space cannot be reproduced in CMY, so it is important to preview the converted image.  You might never be able to get the color you want, but at least you won't be surprised when you see the final output.

Next month we'll delve into some specifics of calibrating your system.  [well, it turns out that I never did get another article on calibration out, largely because I never felt that I understood it well enough to go beyond the basics.  I've learned a little more since then, but it is still not something for which I would claim to be an expert.]

 


Copyright (C) 2004 Greg Marshall

No portion of this web site may be copied or reproduced in any manner without express written consent.