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


gives a list of images corresponding to the components of colorspace.


returns a single-channel image containing the specified channel.


  • ColorSeparate is typically used to separate a multichannel image into single-channel images or to extract a specific color channel such as the red channel or the alpha channel.
  • ColorSeparate[image,{c1,c2,}] extracts the specified color components.
  • ColorSeparate works with arbitrary 2D and 3D images.
  • 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
    Automaticchannels of the image color space
  • The 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


open allclose all

Basic Examples  (2)

Separate an RGB image into three channels:

Extract the luminance channel of an image:

Scope  (6)

By default, an image is separated into the channels of its native color space. Red, green and blue channels of an RGB image:

Hue, saturation and brightness of the image converted to the HSB space:

Extract the blue channel:

Extract the luminance channel:

Compare color separation in different color spaces:

Red, green and blue channels of a 3D image:

Applications  (6)

Extract red objects by subtracting the blue and green color planes from the red color plane:

Colorize separated channels:

Segment foreground from background by thresholding the saturation values:

Display an RGB image using eight colors only:

Convert a color image to grayscale by selecting the maximum channel value of each pixel:

Compute the gradient of a multichannel image using three different methods:

Properties & Relations  (3)

The luminance of an image in RGB and Lab color spaces is the same:

The average pixel value of an RGB image and the luminance value are different:

Compare luminance-related channels in three different color spaces:

The "V" and "K" channel values are negatives of each other:

Separating colors of an image in a space is equivalent to color separation after converting to that space:

Wolfram Research (2008), ColorSeparate, Wolfram Language function, (updated 2014).


Wolfram Research (2008), ColorSeparate, Wolfram Language function, (updated 2014).


@misc{reference.wolfram_2021_colorseparate, author="Wolfram Research", title="{ColorSeparate}", year="2014", howpublished="\url{}", note=[Accessed: 28-October-2021 ]}


@online{reference.wolfram_2021_colorseparate, organization={Wolfram Research}, title={ColorSeparate}, year={2014}, url={}, note=[Accessed: 28-October-2021 ]}


Wolfram Language. 2008. "ColorSeparate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014.


Wolfram Language. (2008). ColorSeparate. Wolfram Language & System Documentation Center. Retrieved from