VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-gm-channel-function/

⇱ Node.js GM channel() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js GM channel() Function

Last Updated : 28 Apr, 2025

The channel() function is an inbuilt function in the GraphicsMagick library which is used to extract a particular channel from the image. 

Syntax:

channel( channelType )

Parameters: This function accepts a 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. 

Example 1: 

Output:

 👁 Image
 

Example 2: 

Output:

 👁 Image
 

Reference:

Comment

Explore