L*a*b* Color measurements and Color Correction
Color measurements and color correction tools are located on the Measure tab, in the Color ribbon group.
The module makes color measurements in CIE L*a*b* or XYZ color coordinates.
This module also provides easy to use tools for color correction.
The dropdown menu button contains four items that open dialogs with color measurements and color correction tools:
Color Measurements
The color measurements panel measures colors under the cursor and extracts color channels as monochrome images.
CIE L*a*b* color measurements can be made with 2 methods:
- sRGB color model
- Color profile
sRGB (standard Red Green Blue) is an RGB color space created cooperatively by HP and Microsoft in 1996 for use on monitors, printers and the Internet, and subsequently standardized by the IEC in 1999. It is often used as the "default" color space for images that do not contain any color space information, especially if the images are stored as 8-bit integers. The sRGB color model assumes that RGB colors are captured with the standard D65 illuminant. More info can be found here.
The sRGB color model can be used with images that do not have an associated color profile or when only measurements of color differences are required after executing of color correction to sRGB space.
If an image has its own color profile, the Use color profile option should be used. In this case color profile associated with the image or the working color profile provide the correct XYZ and L*a*b* measurements.
Click the Load button and select your ICC or CMM color profile file from disk.
The Reset button removes a color profile from the image and activates the working color profile for measurements. The working color profile can be selected using the Select working color profile button from the Reset drop-down menu. It can be reset to the default sRGB IEC61966-2.1 by clicking the Reset working color profile button.
If an image has its own color profile, it can be converted to the working color profile by clicking the Convert image to working profile button from the Reset drop-down.
CIE L*a*b* measurements are also available for any Region objects using Count/Size or Measure operations
Note: L*a*b* color measurements generated by Count/Size use the color measurement method, color profile and Illuminant selected in the color measurements dialog.
The bottom part of the dialog provides measurement values under cursor on the active image.
The RGB group shows red, green, and blue values under the cursor. The Color Space/Illuminant group show the color space value beneath the cursor. Select the appropriate color space and illuminant from the drop-down menus.
The following color spaces are available:
- Lab – CIE Lab color space
- XYZ – intermediate color space between RGB and Lab spaces
- YIQ - the color space used by the NTSC color TV system, employed mainly in North and Central America, and Japan. I stands for in-phase, Q stands for quadrature, and the Y component represents the luma. (https://en.wikipedia.org/wiki/YIQ )
- CMY – the subtractive color model used in color printing, cyan, magenta, yellow. (https://en.wikipedia.org/wiki/CMYK_color_model ).
Note: YIQ and CMY are not absolute color measurement spaces and are listed in the dialog for completeness of color measurements on the image.
The Illuminant defines the type of light source used when the image was taken. The following standard illuminants are listed:
- D50 - CIE standard illuminant D50. Simulates warm daylight at sunrise or sunset with correlated color temperature of 5003 K. Also known as horizon light. (all color profiles use it as PCS color space)
- D55 - CIE standard illuminant D55. Simulates mid-morning or mid-afternoon daylight with correlated color temperature of 5500 K.
- D65 - CIE standard illuminant D65. Simulates noon daylight with correlated color temperature of 6504 K (used with sRGB color space).
- A - CIE standard illuminant A. Simulates typical, domestic, tungsten-filament lighting with correlated color temperature of 2856 K.
- C - CIE standard illuminant C. Simulates average or north sky daylight with correlated color temperature of 6774 K.
- E - Equal-energy radiator. Useful as a theoretical reference.
The Illuminant affects XYZ and Lab color measurements. It's preferable to use the native Illuminant for specific color profiles, for example the sRGB model uses the D65 illuminant, while Color profiles use the D50 illuminant as the intermediate white point.
Each channel of a color image can be extracted to a monochrome image by clicking the Extract button.
Reference colors
Color measurements can be verified using reference color images called color checkers, for example the Gretag-Macbeth Color checker.
The Gretag-Macbeth Color checker has 24 colors covering the visual gamut and has known colors published on the net.
The color checker image ‘ColorChecker_sRGBD65.tif’ is installed in the Colors folder of the demo images.
The RGB values of every color are generated with the D65 illuminant. The list of patch values can be found in wikipedia .
Color Correction
The color correction tool adjusts the colors of one image to the colors of the reference image with known L*a*b* coordinates or just to a reference color patch, so that the colors can be measured or compared.
Typically, the reference image is a color checker such as the Macbeth Color Checker or just an image with color patches. The target image should contain the color checker.
Place manual Tags as reference points on corresponding color patches in both the reference image and the active images and execute color correction.
2 transform types are available:
- Polynomial
- Thin Plate Spline
With the Polynomial transform type the images may have from 3 to 20 points for color correction. A polynomial transform is created by matching colors on the active and reference images. The type of the polynomial depends on the number of tags:
- 3-point calibration corrects color gain
- 4-point calibration corrects color shift and gain
- 7-point calibration corrects the linear color mix
- 10-point calibration corrects the color mix using polynomial approximation of power 2
- 20-point calibration corrects the color mix using polynomial approximation of power 3
Polynomial transform is recommended for use with a small number of reference points (3-7), as high degree polynomials may produce unexpected color distortions for colors in between references.
The Thin Plate Spline transform can be used with 3 or more reference points. This method produces smoother color space transforms compared to Polynomial transforms with a large number of points, though reference point colors may not match exactly when Regularization is more than zero.
Thin Plate Spline transforms are recommended for many tags such as full 24-point matching with the Macbeth color checker.
Point Radius – the radius of the measurement circle at the tag position in pixels. The average RGB values of the circle region are used for color matching. When the value is one a single pixel value is extracted.
Regularization – a smoothing parameter used only with the Thin Plate Spline transform method. Increasing the value will smooth the color transform, though the reference values may not match exactly.
Typical color correction workflow
Add tags to both your color checker, and to the color checker in your active image. Tags must be added to the same positions in both images, and in the same order.
Tags can be added by activating the Manual Tag tool and clicking on the color patches on the image. Tag positions can be modified after activating the Select tool, selecting and moving or deleting tags using the Delete key.
You can add the whole grid of color tags by clicking the Add Grid button. You will be prompted to click the centers of each of the corner color patches, starting at the top left and then moving clockwise. At the final point, close the polygon with a double click or press the Enter key. The tag pattern is then created automatically.
The tags on corresponding color patches on the active image should be created in the same way and then the color transform can be creating by clicking Correct Colors.
The transform can be saved to file using the Save button. When the transform is saved, it can be used for correcting the current or other color images taken under the same conditions. Images taken under the same conditions do not need to contain the color checker.
The correction can be undone using the Undo button.
After the correction the RGB values of the color patches at tag positions will be transformed to RGB values of the reference image and L*a*b* or XYZ measurements can be performed properly on areas of the image outside of the color checker, or on images that do not contain the color checker.
Measure Delta E
You can measure the color differences between an active image and a color checker chart by clicking the Measure Delta E button in the Color tool group. The measurements table is populated with color measurements from both the active image and the reference image, as well as differences between the two.
Delta E is 0 for each point following the correct application of a color transform.
Visualize Color Transform
You can display color transforms in a color cube by clicking the Visualize Color Transform button.
Apply tags to both your reference image and to your image to transform. Activate the reference image, then activate the image to transform, and click the Visualize Color Transform button.
The reference colors will be added as lines and spheres. The yellow spheres show RGB color coordinates of reference points and the arrows point to the RGB color coordinates of the same points in the image to transform. The longer the arrows, the larger the color difference between the two images.