Set color channel

Set color channel

Sets a color channel in a color image.

Inputs

image
A color image.
channelIndex
The index of the color channel to set. 0 = Red, 1 = Green, 2 = Blue, 3 = Alpha.
channel
A color or gray level image that replaces the color channel at channelIndex. The size of the channel image must match that of image. If channel is a color image, the corresponding color channel will be copied.

Outputs

image
A color image.