Main Content


颜色空间转换,支持国际色彩联盟 (ICC) 配置文件

该工具箱将颜色表示为 RGB 值,但除了 RGB 之外,还有其他一些以数值形式表示颜色的模型。之所以存在各种颜色空间,是因为它们表达颜色信息时所采用的方法可使某些计算更为便捷,或是因为它们提供了更为直观的颜色辨识方法。工具箱提供将颜色数据从一个颜色空间转换到另一个颜色空间的函数。工具箱还支持通过国际色彩联盟 (ICC) 配置文件来描述颜色。



rgb2hsv将 RGB 颜色转换为 HSV
rgb2lab将 RGB 转换为 CIE 1976 L*a*b*
rgb2ntscConvert RGB color values to NTSC color space
rgb2xyz将 RGB 转换为 CIE 1931 XYZ
rgb2ycbcr将 RGB 颜色值转换为 YCbCr 颜色空间
rgbwide2ycbcrConvert wide-gamut RGB color values to YCbCr color values (自 R2020b 起)
rgbwide2xyzConvert wide-gamut RGB color values to CIE 1931 XYZ color values (自 R2020b 起)
hsv2rgb将 HSV 颜色转换为 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
xyz2lab将 CIE 1931 XYZ 转换为 CIE 1976 L*a*b*
xyz2rgbConvert CIE 1931 XYZ to RGB
xyz2rgbwideConvert CIE 1931 XYZ color values to wide-gamut RGB color values (自 R2020b 起)
ycbcr2rgb将 YCbCr 颜色值转换为 RGB 颜色空间
ycbcr2rgbwideConvert YCbCr color values to wide-gamut RGB color values (自 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
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 (自 R2020b 起)
imcolordiffColor difference based on CIE94 or CIE2000 standard (自 R2020b 起)


  • 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.