This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

ColorConvert

ColorConvert[expr, colspace]
converts color specifications in expr to refer to the color space represented by colspace.
  • The expression expr can be a color specification such as RGBColor[...] or Red, an Image object, or an explicit list of color channel values.
  • ColorConvert[list, ...] by default interprets list as follows:
{v}gray level
{v,a}gray level and Alpha parameter
{r,g,b}red, green, blue levels
{r,g,b,a}RGB with Alpha parameter
"RGB"red, green, blue
"Grayscale"gray level
"CMYK"cyan, magenta, yellow, black
"HSB"hue, saturation, brightness
  • With the option setting ColorSpace->src, ColorConvert[list, ...] interprets channel values in list according to the color space src.
Convert a color photo to grayscale:
Convert to a hue-saturation-brightness representation:
This shows that the previous output is an HSB image:
Convert an RGB color object to CMYK:
Convert an intensity value to RGB:
Convert an RGB color object to HSB:
Convert a color photo to grayscale:
In[1]:=
Click for copyable input
Out[1]=
 
Convert to a hue-saturation-brightness representation:
In[1]:=
Click for copyable input
Out[1]=
This shows that the previous output is an HSB image:
In[2]:=
Click for copyable input
Out[2]=
 
Convert an RGB color object to CMYK:
In[1]:=
Click for copyable input
Out[1]=
 
Convert an intensity value to RGB:
In[1]:=
Click for copyable input
Out[1]=
 
Convert an RGB color object to HSB:
In[1]:=
Click for copyable input
Out[1]=
New in 7