| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Image Processing Toolbox |
| Contents | Index |
| Learn more about Image Processing Toolbox |
C = makecform(type)
C = makecform(type,'WhitePoint',
WP)
C = makecform('icc', src_profile, dest_profile)
C = makecform('icc', src_profile, dest_profile,
'SourceRenderingIntent', src_intent, 'DestRenderingIntent',
dest_intent)
C = makecform('clut', profile, LUTtype)
C = makecform('mattrc', MatTrc, 'Direction', direction)
C = makecform('mattrc', profile, 'Direction', direction)
C = makecform('mattrc', profile, 'Direction', direction,
'RenderingIntent', intent)
C = makecform('graytrc', profile, 'Direction', direction)
C = makecform('graytrc', profile, 'Direction', direction,
'RenderingIntent', intent)
C = makecform('named', profile, space)
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 also supports conversions to and from the sRGB and CMYK color spaces. For a list of the abbreviations used by the Image Processing Toolbox software for each color space, see the Remarks section of this reference page.
Type | Description |
|---|---|
'cmyk2srgb' | Convert from the CMYK color
space to the
|
'lab2lch' | Convert from
|
'lab2srgb' | Convert from
|
'lab2xyz' | Convert from
|
'lch2lab' | Convert from
|
'srgb2cmyk' | Convert from
|
'srgb2lab' | Convert from
|
'srgb2xyz' | Convert from
|
'upvpl2xyz' | Convert from
|
'uvl2xyz' | Convert from
|
'xyl2xyz' | Convert from
|
'xyz2lab' | Convert from
|
'xyz2srgb' | Convert from
|
'xyz2upvpl' | Convert from
|
'xyz2uvl' | Convert from
|
'xyz2xyl' | Convert from
|
C = makecform(type,'WhitePoint', WP) specifies the value of the reference illuminant, known as the white point. type can be either 'xyz2lab' or 'lab2xyz'. WP is a 1-by-3 vector of XYZ values scaled so that Y = 1. The default is the CIE illuminant D50, which is also the default illuminant specified in the International Color Consortium specifications ICC.1:2001-04 and ICC.1:2001-12. 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 an 8-bit or 16-bit LUTtag that performs a transformation between device colors and PCS colors using a particular rendering. For more information about 'clut' transformations, see Section 6.5.7 of the International Color Consortium specification ICC.1:2001-04 (Version 2) or Section 6.5.9 of ICC.1:2001-12 (Version 4), available at www.color.org.
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 or ICC.1:2001-12, available at www.color.org.
C = makecform('mattrc', profile, 'Direction', direction) creates a color transform based on the MatTRC field of the given ICC profile structure profile. direction is either 'forward' or 'inverse' and specifies whether the MatTRC is applied in the forward (RGB to XYZ) or inverse (XYZ to RGB) direction.
C = makecform('mattrc', profile, 'Direction', direction, 'RenderingIntent', intent) is similar, but adds the option of specifying the rendering intent. intent must be either 'RelativeColorometric' (the default) or 'AbsoluteColorimetric'. When 'AbsoluteColorimetric' is specified, the colorimetry is referenced to a perfect diffuser, rather than to the Media White Point of the profile.
C = makecform('graytrc', profile, 'Direction', direction) creates the color transformation structure C that specifies a monochrome transform based on a single-channel Tone Reproduction Curve (GrayTRC) contained in an ICC color profile. direction can be either 'forward' or 'inverse' and specifies whether the grayTRC transform is to be applied in the forward (device to PCS) or inverse (PCS to device) direction.
C = makecform('graytrc', profile, 'Direction', direction, 'RenderingIntent', intent) is similar but adds the option of specifying the rendering intent. intent must be either 'RelativeColorimetric' (the default) or 'AbsoluteColorimetric'. When 'AbsoluteCorimetric' is specified, the colorimetry is referenced to a perfect diffuser, rather than to the Media White Point of the profile.
C = makecform('named', profile, space) creates the color transformation structure C that specifies the transformation from color names to color-space coordinates. profile must be a profile structure for a Named Color profile (with a NamedColor2 field). space is either 'PCS' or 'Device'. The 'PCS' option is always available and will return L*a*b* or XYZ coordinates, depending on the 'ConnectionSpace' field in profile.Header, in 'double' format. The 'Device' option, when active, returns device coordinates, the dimension depending on the 'ColorSpace' field in profile.Header, also in 'double' format.
The Image Processing Toolbox software 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), where x and y refer to the xy-coordinates of the associated CIE chromaticity diagram, and l refers to Y (luminance). |
uvl | 1960 CIE uvY values, where u and v refer to the uv-coordinates, and l refers to Y (luminance). |
upvpl | 1976 CIE
|
lab | 1976 CIE
|
lch | Polar transformation of CIE
|
cmyk | Standard values used by printers |
srgb | Standard computer monitor RGB values, (IEC 61966-2-1) |
Convert RGB image to L*a*b*, assuming input image is uint8.
rgb = imread('peppers.png');
cform = makecform('srgb2lab');
lab = applycform(rgb,cform); Convert from a non-standard RGB color profile to the device-independent XYZ profile connection space. Note that the ICC input profile must includes a MatTRC value.
InputProfile = iccread('myRGB.icc');
C = makecform('mattrc',InputProfile.MatTRC, ...
'direction', 'forward');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.
![]() | labelmatrix | makeConstrainToRectFcn | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |