Image Processing Toolbox User's Guide Previous page   Next Page
makecform

Create a color transformation structure

Syntax

Description

C = makecform(type) creates the color transformation structure C that defines the color space conversion specified by type. To perform the transformation, pass the color transformation structure as an argument to the applycform function.

The type argument specifies one of the conversions listed in the following table. makecform supports conversions between members of the family of device-independent color spaces defined by the CIE, Commission Internationale de l'Éclairage (International Commission on Illumination). In addition, makecform supports conversions to and from the sRGB standard. For a list of the abbreviations used by the Image Processing Toolbox for each color space, see the Remarks section of this reference page.

Type
Description
'lab2lch'
Convert from to the color space.
'lab2srgb'1
Convert from to the color space.
'lab2xyz'1
Convert from to the color space.
'lch2lab'
Convert from to the color space.
'srgb2lab'1
Convert from to the color space.
'srgb2xyz'
Convert from to the color space.
'upvpl2xyz'
Convert from to the color space.
'uvl2xyz'
Convert from to the color space.
'xyl2xyz'
Convert from to the color space.
'xyz2lab'1
Convert from to the color space.
'xyz2srgb'
Convert from to the color space.
'xyz2upvpl'
Convert from to the color space.
'xyz2uvl'
Convert from to the color space.
'xyz2xyl'
Convert from to the color space.

1 For the 'xyz2lab', 'lab2xyz', 'srgb2lab', and 'lab2srgb' transforms, you can optionally specify the value of the reference illuminant, known as the white point. Use the syntax

where WP is a 1-by-3 vector of XYZ values scaled so that Y = 1. The default is the CIE illuminant D50 as specified in the International Color Consortium specification ICC.1:2001-04 and ICC.1:2001-12. You can use the whitepoint function to create the WP vector.

C = makecform('icc', src_profile, dest_profile) creates a color transform based on two ICC profiles. src_profile and dest_profile are ICC profile structures returned by iccread.

C = makecform('icc', src_profile, dest_profile, 'SourceRenderingIntent', src_intent, 'DestRenderingIntent', DEST_INTENT) creates a color transform based on two ICC color profiles, src_profile and dest_profile, specifying rendering intent arguments for the source, src_intent, and the destination, dest_intent, profiles.

Rendering intents specify the style of reproduction that should be used when these profiles are combined. For most devices, the range of reproducible colors is much smaller than the range of colors represented by the PCS. Rendering intents define gamut mapping techniques. Possible values for these rendering intents are listed below. Each rendering intent has distinct aesthetic and color-accuracy tradeoffs.

Value
Description
'AbsoluteColorimetric'
Maps all out-of-gamut colors to the nearest gamut surface while maintaining the relationship of all in-gamut colors. This absolute rendering contains color data that is relative to a perfectly reflecting diffuser.
'Perceptual' (default)
Employs vendor-specific gamut mapping techniques for optimizing the range of producible colors of a given device. The objective is to provide the most aesthetically pleasing result even though the relationship of the in-gamut colors might not be maintained. This media-relative rendering contains color data that is relative to the device's white point.
'RelativeColorimetric'
Maps all out-of-gamut colors to the nearest gamut surface while maintaining the relationship of all in-gamut colors. This media-relative rendering contains color data that is relative to the device's white point.
'Saturation'
Employs vendor-specific gamut mapping techniques for maximizing the saturation of device colors. This rendering is generally used for simple business graphics such as bar graphs and pie charts. This media-relative rendering contains color data that is relative to the device's white point.

C = makecform('clut', profile, LUTtype) creates the color transformation structure C based on a color lookup table (CLUT) contained in an ICC color profile. profile is an ICC profile structure returned by iccread. LUTtype specifies which clut in the profile structure is to be used. Each LUTtype, listed in the table below, contains the components of a 8-bit or 16-bit LUTtag that performs a transformation between device colors and PCS colors using a particular rendering.

LUT Type
Description
'AToB0'
Device to PCS: perceptual rendering intent
'AToB1'
Device to PCS: media-relative colorimetric rendering intent
'AToB2'
Device to PCS: saturation rendering intent
'AToB3'
Device to PCS: ICC-absolute rendering intent
'BToA0'
PCS to device: perceptual rendering intent
'BToA1'
PCS to device: media-relative colorimetric rendering intent
'BToA2'
PCS to device: saturation rendering intent
'BToA3'
PCS to device: ICC-absolute rendering intent
'Gamut'
Determines which PCS colors are out of gamut for a given device
'Preview0'
PCS colors to the PCS colors available for soft proofing using the perceptual rendering
'Preview1'
PCS colors available for soft proofing using the media-relative colorimetric rendering.
'Preview2'
PCS colors to the PCS colors available for soft proofing using the saturation rendering.

C = makecform('mattrc', MatTrc, 'Direction', direction) creates the color transformation structure C based on a Matrix/Tone Reproduction Curve (MatTRC) model, contained in an ICC color profile. direction can be either 'forward' or 'inverse' and specifies whether the MatTRC is to be applied in the forward or inverse direction. For more information, see section 6.3.1.2 of the International Color Consortium specification ICC.1:2001-04 (www.color.org).

Remarks

The Image Processing Toolbox uses the following abbreviations to represent color spaces.

Abbreviation
Description
xyz
1931 CIE XYZ tristimulus values (2° observer)
xyl
1931 CIE xyY chromaticity values (2° observer)
uvl
1960 CIE uvL values
upvpl
1976 CIE the values
lab
1976 CIE values
lch
Polar transformation of CIE values, where c = chroma and h = hue
srgb
Standard computer monitor RGB values, (IEC 61966-2-1)

Example

Convert RGB image to L*a*b*, assuming input image is uint8.

See Also

applycform, iccread, iccwrite, isicc, lab2double, lab2uint16, lab2uint8, whitepoint, xyz2double, xyz2uint16

For a full list of the toolbox color space conversion functions, see Color Space Conversions.


Previous page  label2rgb makelut Next page

© 1994-2005 The MathWorks, Inc.