Main Content

Color

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 supports International Color Consortium (ICC) profiles for describing colors.

Functions

expand all

rgb2hsvConvert RGB colors to HSV
rgb2labConvert RGB to CIE 1976 L*a*b*
rgb2ntscConvert RGB color values to NTSC color space
rgb2xyzConvert RGB to CIE 1931 XYZ
rgb2ycbcrConvert RGB color values to YCbCr color space
rgbwide2ycbcrConvert wide-gamut RGB color values to YCbCr color values (Since R2020b)
rgbwide2xyzConvert wide-gamut RGB color values to CIE 1931 XYZ color values (Since R2020b)
hsv2rgbConvert HSV colors to RGB
lab2rgbConvert CIE 1976 L*a*b* to RGB
lab2xyzConvert CIE 1976 L*a*b* to CIE 1931 XYZ
ntsc2rgbConvert NTSC values to RGB color space
xyz2labConvert CIE 1931 XYZ to CIE 1976 L*a*b*
xyz2rgbConvert CIE 1931 XYZ to RGB
xyz2rgbwideConvert CIE 1931 XYZ color values to wide-gamut RGB color values (Since R2020b)
ycbcr2rgbConvert YCbCr color values to RGB color space
ycbcr2rgbwideConvert YCbCr color values to wide-gamut RGB color values (Since R2020b)
colorcloudDisplay 3-D color gamut as point cloud in specified color space
lab2doubleConvert L*a*b* color values to double
lab2uint16Convert L*a*b color values to uint16
lab2uint8Convert L*a*b color values to uint8
xyz2doubleConvert XYZ color values to double
xyz2uint16Convert XYZ color values to uint16
iccfindFind ICC profiles
iccreadRead ICC profile
iccrootFind system default ICC profile repository
iccwriteWrite ICC color profile data
isiccCheck for valid ICC profile data
makecformCreate color transformation structure
applycformApply device-independent color space transformation
imapproxApproximate indexed image by reducing number of colors
chromadaptAdjust color balance of RGB image with chromatic adaptation
illumgrayEstimate illuminant using gray world algorithm
illumpcaEstimate illuminant using principal component analysis (PCA)
illumwhiteEstimate illuminant using White Patch Retinex algorithm
lin2rgbApply gamma correction to linear RGB values
rgb2linLinearize gamma-corrected RGB values
whitepointXYZ color values of standard illuminants
colorangleAngle between two RGB vectors
deltaEColor difference based on CIE76 standard (Since R2020b)
imcolordiffColor difference based on CIE94 or CIE2000 standard (Since R2020b)

Topics

  • Understanding Color Spaces and Color Space Conversion

    A color space maps a color in a multidimensional coordinate system. Color spaces have different advantages in identifying colors or performing calculations.

  • Device-Independent Color Spaces

    Device-independent color spaces define a standardized color space where three values represent a color. Different standards exist for many applications of color display.

  • Profile-Based Color Space Conversions

    Device profiles contain information about how input, output, and display devices reproduce colors. Convert the color space so displayed colors look the same across all devices.

  • Display Colors

    The bit depth of a screen display defines how many distinct colors the display can produce. You can determine and change the screen bit depth of your system.

  • Reduce the Number of Colors in an Image

    Reduce the number of colors in an image using quantization, colormap mapping, or dithering.

Featured Examples