Evident LogoOlympus Logo

Balancing Color in Digital Images

Balancing Color in Digital Images - Java Tutorial

Color balancing belongs to a class of digital image enhancement algorithms that are useful for correcting color casts in captured images. In most cases, unusual overall color casts (or uniform discolorations) typically result from color temperature effects in specimen illumination or improper adjustment of the electronic detector (usually a digital CCD camera system) used to capture the image.

This interactive tutorial explores the image enhancement technique of color balancing, commonly a feature of many image-editing software packages. The tutorial initializes with a randomly selected specimen image (captured in the microscope) appearing in the window entitled Specimen Image. Each specimen name includes, in parentheses, an abbreviation designating the contrast mechanism employed in obtaining the image. The following nomenclature is used: (FL), fluorescence; (BF), brightfield; (DF), darkfield; (PC), phase contrast; (DIC), differential interference contrast (Nomarski); (HMC), Hoffman modulation contrast; and (POL), polarized light. Visitors will note that specimens captured using the various techniques available in optical microscopy behave differently during image processing in the tutorial. Before the image has been loaded into the Specimen Image window, the tutorial randomly introduces a color cast that must be corrected by operation of the Color Balance sliders described below.

To operate the tutorial, select a specimen image from the Choose A Specimen pull-down menu, and select a tonal range channel (Shadows, Midtones, Highlights) to modify from the Tonal Range radio button panel (the tutorial default setting is Midtones). After selecting a channel, adjust the tonal range by utilizing the Cyan/Red, Magenta/Green and/or Yellow/Blue sliders. Each time a new channel is selected using the radio buttons, the sliders can be utilized to adjust the tone values for that particular range. As the sliders are adjusted, the numerical value of the tonal adjustment is indicated in the color balance text input boxes positioned above the sliders. To re-initialize the image correction of a particular channel, use the blue Reset button to erase all of the adjusted tonal values in that channel.

Appearing to the right of the Specimen Image window is the RGB Histogram window, which displays the red, green, and blue histograms of the specimen image. The Red, Green, and Blue checkboxes may be utilized to enable or disable any of the channels that are displayed in the RGB Histogram window. To enable a view of the image grayscale histogram in the histogram window, use the mouse cursor to select the Grayscale Histogram checkbox positioned beneath the Tonal Range radio button panel. When this option is selected, the title of the RGB Histogram window changes to Grayscale Histogram. The original image can be viewed and compared to the currently modified image by placing a checkmark in the Show Original checkbox. Visitors are encouraged to explore the effects of color balancing on the appearance of the specimen images (and their histograms) in the tutorial.

Balancing color relies on an enhancement algorithm that enables the adjustment of the balance between red and cyan, green and magenta, and blue and yellow tones in a digital image. The technique is similar to a brightness-mapping algorithm that specifies an output brightness value for each input brightness value in the image. For this reason, color balancing is often implemented procedurally as a lookup-table (LUT) operation. In order to achieve added flexibility, color balancing treats shadows, midtones, and highlights separately by subdividing the image into three sets of pixels that have low, medium, and high brightness levels, respectively. For each of the brightness categories, a unique lookup-table function is utilized in order to target the appropriate range of brightness values.

The color balancing algorithm can be utilized to correct a cast or color tinge in a digital image that occurs during capture when the microscope or digital imaging device is not properly adjusted. As an example, if an image has an unwanted blue cast in the shadow regions, then the problem can often be corrected by shifting the yellow-blue balance slightly toward yellow in the shadows channel. When the color balance of an image changes, pixel luminosity (brightness) values, which are measured in terms of the corresponding grayscale pixel's brightness level, may also change. In order to maintain the same brightness relationships between pixels in the color balanced image, a preserve luminosity option is often included (and is available as a disabled setting in the tutorial) in software or hardware implementations of color balancing. Visitors should compare the effects of color balancing on each of the image histograms when the Preserve Luminosity feature is enabled versus when it is disabled.

Color balancing is a useful tool for many types of image enhancement operations, but it does not provide adequate precision for modifying a narrow range of colors in some digital images. When an application requires greater precision than color balancing can provide, other methods such as interactive lookup-table modification should be considered instead.

Contributing Authors

Kenneth R. Spring - Scientific Consultant, Lusby, Maryland, 20657.

John C. Russ - Materials Science and Engineering Department, North Carolina State University, Raleigh, North Carolina, 27695.

Matthew Parry-Hill, Thomas J. Fellers, Laurence D. Zuckerman, and Michael W. Davidson - National High Magnetic Field Laboratory, 1800 East Paul Dirac Dr., The Florida State University, Tallahassee, Florida, 32310.

Sorry, this page is not
available in your country.

Sorry, this page is not available in your country