ColorSeparate

ColorSeparate[image]
gives a list of single-channel images corresponding to each of the color channels in image.

ColorSeparate[image,colorspace]
gives a list of images corresponding to the components of colorspace.

ColorSeparate[image,channel]
returns a single-channel image containing the specified channel.

DetailsDetails

  • ColorSeparate works with 2D or 3D images containing any number of channels.
  • ColorSeparate[image,{c1,c2,}] extracts the specified color components.
  • The following colorspace specifications can be given:
  • "RGB"red, green, blue
    "RGBA"red, green, blue, alpha
    "CMYK"cyan, magenta, yellow, black
    "HSB"hue, saturation, brightness
    "XYZ"channels of the CIE XYZ color space
    "LAB"channels of the CIE LAB color space
    "LCH"channels of the CIE LCH color space
    "LUV"channels of the CIE LUV color space
  • channel specification can be one of the following:
  • "I"gray-level (intensity)
    "L"luminance channel of Lab
    "R","G","B"red, green, blue from RGB
    "C","M","Y","K"cyan, magenta, yellow, black from CMYK
    "H","S","V"hue, saturation, brightness (value) from HSB
    "Average"mean of all channels
    "A"alpha channel

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Separate an RGB image into three channels:

In[1]:=
Click for copyable input
Out[1]=

Separate the channels of an HSB image:

In[1]:=
Click for copyable input
Out[1]=

Separate the channels of a 3D image:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2008
(7.0)
| Updated in 2014
(10.0)