Main Content

Device-Independent Color Spaces

The standard terms used to describe colors, such as hue, brightness, and intensity, are subjective and make comparisons difficult.

In 1931, the International Commission on Illumination, known by the acronym CIE, forCommission Internationale de l'Éclairage, studied human color perception and developed a standard, called the CIE XYZ. This standard defined a three-dimensional space where three values, called tristimulus values, define a color. This standard is still widely used today.

In the decades since that initial specification, the CIE has developed several additional color space specifications that attempt to provide alternative color representations that are better suited to some purposes than XYZ. For example, in 1976, in an effort to get a perceptually uniform color space that could be correlated with the visual appearance of colors, the CIE created theL*a*b*color space.

Convert Between Device-Independent Color Spaces

Image Processing Toolbox™ supports conversions between members of the CIE family of device-independent color spaces. In addition, the toolbox also supports conversions between these CIE color spaces and the sRGB color space. This color space was defined by an industry group to describe the characteristics of a typical PC monitor.

This table lists all the device-independent color spaces that the toolbox supports.

Color Space

Description

Supported Conversions

XYZ

The original, 1931 CIE color space specification.

xyY,uvl,u′v′L, andL*a*b*

xyY

CIE specification that provides normalized chromaticity values. The capitalYvalue represents luminance and is the same as inXYZ.

XYZ

uvL

CIE specification that attempts to make the chromaticity plane more visually uniform.L亮度和是一样的吗YinXYZ.

XYZ

u′v′L

CIE specification in whichuandvare rescaled to improve uniformity.

XYZ

L*a*b*

CIE specification that attempts to make the luminance scale more perceptually uniform.L*is a nonlinear scaling ofL, normalized to a reference white point.

XYZ

L*ch

CIE specification wherecis chroma andhis hue. These values are a polar coordinate conversion ofa*andb *inL*a*b*.

L*a*b*

sRGB

Standard adopted by major manufacturers that characterizes the average PC monitor.

XYZandL*a*b*

Color Space Data Encodings

When you convert between two device-independent color spaces, the data type used to encode the color data can sometimes change, depending on what encodings the color spaces support. In the preceding example, the original image isuint8数据。XYZ转换uint16数据。The XYZ color space does not define auint8encoding. The following table lists the data types that can be used to represent values in all the device-independent color spaces.

Color Space

Encodings

XYZ

uint16double

xyY

double

uvL

double

u'v'L

double

L*a*b*

uint8,uint16, ordouble

L*ch

double

RGB

double uint8 uint16

一个s the table indicates, certain color spaces have data type limitations. For example, the XYZ color space does not define auint8encoding. If you convert 8-bit CIE LAB data into the XYZ color space, the data is returned inuint16format. To change the encoding of XYZ data, use these functions:

  • xyz2double

  • xyz2uint16

To change the encoding of L*a*b* data, use these functions:

  • lab2double

  • lab2uint8

  • lab2uint16

To change the encoding of RGB data, use these functions:

  • im2double

  • im2uint8

  • im2uint16