LUT for Color Balance

A color image can be improved by changing gamma correction and white balance.

These effects can be corrected efficiently by setting up a lookup table using WhiteBalance and applying it on a series of images by means of Transform. The LUT only needs to be prepared once (it implements a decoupled color transformation).

Gamma precompensation

Many color cameras use a gamma precompensation process that deals with the non-linear response of the display device (such as a TV monitor).

Gamma precompensation should be used after processing because using it before would change the result because of the nonlinearity introduced.

The precompensation process applies the inverse transform to the signal, so that the image renders correctly on the display. Three predefined gamma values are available, depending on the video standard at hand:

Video standard

Gamma value

EasyColor property

NTSC

1/2.2

CompensateNtscGamma

PAL

1/2.8

CompensatePalGamma

SMPTE

0.45

CompensateSmpteGamma

Precompensation cancellation and pure precompensation correspond to exponents that are inverse of each other.

Gamma precompensation cancellation

Many color cameras have a built-in gamma precompensation feature that can be turned off. If this feature cannot be turned off and is not desired, its effect can be canceled by applying the direct gamma transform. The following predefined gamma values are available for this purpose:

Video standard

Gamma value

EasyColor property

NTSC

2.2

NtscGamma

PAL

2.8

PalGamma

SMPTE

1/0.45

SmpteGamma

White balance

A camera may exhibit color imbalance, that is, the three color channels having mismatched gains, or the illuminant (the light sources) not being perfectly white. When this occurs, the white areas appear as an unsaturated color. The white balance correction automatically adjusts three independent gains so that the components of a white pixel become equal. This means that a white balance calibration step is required, during which a white surface must be shown to the camera and the corresponding color component are measured. PixelAverage can be used for this purpose.

ColorBalanceNone ColorBalanceWhite

Raw image, and image with white balance and gamma precompensation