The channel() function is an inbuilt function in the GraphicsMagick library which is used to extract a particular channel from the image.
channel( channelType )
Parameters: This function accepts single parameter channelType which holds the type of channel name. The types of channels are Red, Green, Blue, Opacity, Matte, Cyan, Magenta, Yellow, Black, or Gray.
Return Value: This function returns the GraphicsMagick object.