Core Optical, Inc.
ColorimetricConverter ConvertLinearRGBtoXYZ Method Industrial Strength, Scientific Grade
Transforms data in-place from linear normalized sRGB to normalized CIE XYZ tristimulus values.

Namespace: PrecisionImage.Colorimetry
Assembly: PrecisionImage (in PrecisionImage.dll) Version: (

public void ConvertLinearRGBtoXYZ(
	SourceData dataSource


Type: PrecisionImage SourceData
A SourceData object encapsulating the image data to be converted.


The conversion is computed in reference to the D65 white point according to the ITU-R BT.709 standard. Results are generally within the nominal range 0.0 - 1.0 but may be fall outside that range depending on the source data. The conversion is applied under the assumption that the data in dataSource represents linearized sRGB values. Resulting values are not clamped to any arbitrary range and are stored as-is with the X values in channel 0, Y values in channel 1 and Z values in channel 2 of the dataSource object. dataSource must contain at least 3 channels or an OnlineArgumentOutOfRangeException exception will result.

The following converts linear RGB data to CIE XYZ space.
using PrecisionImage;
using PrecisionImage.Colorimetry;

// Instantiate the SourceData object. "MyBitmapSource" is an rgb image with no alpha channel: 
SourceData imageData = new SourceData(MyBitmapSource);

// Instantiate the ColorimetricConverter object: 
ColorimetricConverter colorConverter = new ColorimetricConverter();

// Image data is currently in linear RGB space. Transform to CIE XYZ in-place (imageData must have exactly 3 channels 
// or exception will result):

// Assume some processing on one or more of the tristimulus channels:
// After channel processing, transform XYZ values back to linear RGB (in-place):
See Also