This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Color space conversions, support for International Color Consortium (ICC) profiles

The toolbox represents colors as RGB values, but there are other models besides RGB for representing colors numerically. The various color spaces exist because they present color information in ways that make certain calculations more convenient or because they provide a more intuitive way to identify colors. The toolbox provides functions for converting color data from one color space to another. The toolbox also support International Color Consortium (ICC) profiles for describing colors.


rgb2lab Convert RGB to CIE 1976 L*a*b*
rgb2ntsc Convert RGB color values to NTSC color space
rgb2xyz Convert RGB to CIE 1931 XYZ
rgb2ycbcr Convert RGB color values to YCbCr color space
lab2rgb Convert CIE 1976 L*a*b* to RGB
lab2xyz Convert CIE 1976 L*a*b* to CIE 1931 XYZ
xyz2lab Convert CIE 1931 XYZ to CIE 1976 L*a*b*
xyz2rgb Convert CIE 1931 XYZ to RGB
ycbcr2rgb Convert YCbCr color values to RGB color space
ntsc2rgb Convert NTSC values to RGB color space
lab2double Convert L*a*b* data to double
lab2uint16 Convert L*a*b* data to uint16
lab2uint8 Convert L*a*b* data to uint8
xyz2double Convert XYZ color values to double
xyz2uint16 Convert XYZ color values to uint16
iccfind Search for ICC profiles
iccread Read ICC profile
iccroot Find system default ICC profile repository
iccwrite Write ICC color profile to disk file
isicc True for valid ICC color profile
makecform Create color transformation structure
applycform Apply device-independent color space transformation
imapprox Approximate indexed image by reducing number of colors
colorcloud Display 3-D color gamut as point cloud in specified color space
whitepoint XYZ color values of standard illuminants

Examples and How To

Convert from YIQ to RGB Color Space

The YIQ color space, used in televisions in the United States, separates grayscale information from color data.

Convert from YCbCr to RGB Color Space

The YCbCr color space, widely used for digital video, stores luminance and two components of chrominance information.

Convert from HSV to RGB Color Space

The HSV (Hue, Saturation, Value) color space is often used to select paint and ink colors from a color wheel or palette.

Read ICC Profiles

To read an ICC profile into the MATLAB® workspace, use the iccread function.

Write ICC Profile Information to a File

To export ICC profile information from the MATLAB workspace to a file, use the iccwrite function.

Convert Between Device-Independent Color Spaces

Image Processing Toolbox™ supports conversions between members of the CIE family of device-independent color spaces.

Convert RGB to CMYK Using ICC Profiles

This example shows how to convert color data from the RGB color space used by a monitor to the CMYK color space used by a printer.

Determine if L*a*b* value is in RGB gamut

This example shows how to use color space conversion to determine if an L*a*b* value is in the RGB gamut.

Displaying Colors

Describes how to determine the screen bit depth of your system and provides recommendations if you can change the bit depth


When you use rgb2ind or imapprox to reduce the number of colors in an image, the resulting image might look inferior to the original, because some of the colors are lost.

Reducing the Number of Colors in an Image

Reduce the number of colors in an image using the imapprox and rgb2ind functions.

Reducing Colors Using Color Approximation

On systems with 24-bit color displays, truecolor images can display up to 16,777,216 (i.e., 224) colors.

Reducing Colors Using imapprox

Use imapprox when you need to reduce the number of colors in an indexed image.


Understanding Color Spaces and Color Space Conversion

A color space maps a color in a multidimensional coordinate system.

Profile-Based Color Space Conversions

The Color Management System (CMS) provides a means for translating color data between input, output, and display devices.

Device-Independent Color Spaces

Standardized three-dimensional color spaces define each color with three values.

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.

What is Rendering Intent in Profile-Based Conversions?

For most devices, the range of reproducible colors is much smaller than the range of colors represented by the PCS.

Was this topic helpful?