PHP | Imagick separateImageChannel() function Last Updated : 17 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::separateImageChannel() function is an inbuilt function in PHP which is used to separate a channel from the image and returns a grayscale image. A channel is a particular color component of each pixel in the image. Syntax: bool Imagick::separateImageChannel( int $channel ) Parameters:This function accepts a single parameter $channel which holds the integer value corresponding to one of the CHANNEL constants. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the Imagick::separateImageChannel() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Separate the image channel $imagick->separateImageChannel(1); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Apply selectiveBlurImage() function $imagick->separateImageChannel(imagick::CHANNEL_GREEN); // Display the image header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.separateimagechannel.php Comment More infoAdvertise with us Next Article PHP | Imagick separateImageChannel() function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick setImageChannelDepth() Function The Imagick::setImageChannelDepth() function is an inbuilt function in PHP which is used to set the depth of a particular channel image. Syntax: bool Imagick::setImageChannelDepth( $channel, $depth ) Parameters: This function accepts two parameters as mentioned above and described below: $channel: T 2 min read PHP | Imagick setImageScene() Function The Imagick::setImageScene() function is an inbuilt function in PHP which is used to set the image scene. The value of scene contains an integer value. Syntax: bool Imagick::setImageScene( int $scene ) Parameters: This function accepts a single parameter $scene which holds the scene. Return Value: T 1 min read PHP | Imagick setImagePage() Function The Imagick::setImagePage() function is an inbuilt function in PHP which is used to set the image page geometry. Syntax: bool Imagick::setImagePage(int $width, int $height, int $x, int $y ) Parameters: This function accepts four parameters as mentioned above and described below: $width: It specifies 1 min read PHP | Imagick sepiaToneImage() Function The Imagick::sepiaToneImage() function is an inbuilt function in PHP which is used to apply a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning. Syntax: bool Imagick::sepiaToneImage( float $threshold ) Parameters: This function accepts a single parameter 1 min read PHP | Imagick resetImagePage() Function The Imagick::resetImagePage() function is an inbuilt function in PHP which is used to reset the image page. Syntax: bool Imagick::resetImagePage( string $page ) Parameters: This function accepts a single parameter $page which holds the page definition in form of WxH+x+y, where W is for width, H is f 1 min read Like