PHP | Imagick getImageChannelRange() Function Last Updated : 26 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::getImageChannelRange() function is an inbuilt function in PHP which is used to gets the range of channel. Syntax: array Imagick ::getImageChannelRange( $channel ) Parameters: This function accept single parameter $channel which specifies the channel to find image channel range. The default value of channel is Imagick::CHANNEL_DEFAULT. Return Value: This function returns an array containing the minima and maxima of the required channel. Below programs illustrate the Imagick ::getImageChannelRange() function in PHP: Program 1: Original Image: php <?php // Create new Imagick object $im = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-15.png'); // Using getImageChannelRange function // with red channel $res = $im->getImageChannelRange(imagick::CHANNEL_RED); // Display result print_r($res); ?> Output: Array ( [minima] => 0 [maxima] => 65535 ) Program 2: Original Image: php <?php $string = "Computer Science portal for Geeks!"; // Creating new image of above String // and add color $im = new Imagick(); $draw = new ImagickDraw(); // Fill the color in image $draw->setFillColor(new ImagickPixel('green')); // Set the text font size $draw->setFontSize(50); $metrix = $im->queryFontMetrics($draw, $string); $draw->annotation(0, 40, $string); $im->newImage($metrix['textWidth'], $metrix['textHeight'], new ImagickPixel('white')); // Draw the image $im->drawImage($draw); $im->setImageFormat('jpeg'); // Using getImageChannelRange function // with red channel $res = $im->getImageChannelRange(imagick::CHANNEL_GREEN); // Display result print_r($res); ?> Output: Array ( [minima] => 32896 [maxima] => 65535 ) Reference: http://php.net/manual/en/imagick.getimagechannelrange.php Comment More infoAdvertise with us Next Article PHP | Imagick getImageChannelRange() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Imagick +1 More Similar Reads PHP | Imagick getImageChannelMean() Function The Imagick::getImageChannelMean() function is an inbuilt function in PHP which is used to get the mean and standard deviation of one or more image channels. It returns an associative array containing the keys as "mean" and value as "standardDeviation". Syntax: array Imagick::getImageChannelMean(int 1 min read PHP | Imagick getImageChannelExtrema() Function The Imagick::getImageChannelExtrema() function is an inbuilt function in PHP which is used to get the extrema for one or more image channels. Extrema are the points at which a maximum or minimum value of a function is observed. It returns an associative array with the keys "minima" and "maxima". Syn 1 min read PHP | Imagick getImageChannelDepth() Function The Imagick::getImageChannelDepth() function is an inbuilt function in PHP which is used to get the depth for channel image. Syntax: int Imagick::getImageChannelDepth( $channel ) Parameters: This function accepts a single parameter $channel which specifies the channel constant that is valid for chan 2 min read PHP | Imagick getImageScene() Function The Imagick::getImageScene() function is an inbuilt function in PHP which is used to get the image scene of an Imagick object. Syntax: int Imagick::getImageScene( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the image scene. Below programs illus 1 min read PHP | Gmagick getimagechanneldepth() Function The Gmagick::getimagechanneldepth() function is an inbuilt function in PHP which is used to return the depth for channel image.Syntax:Â Â int Gmagick::getimagechanneldepth( $channel_type ) Parameters: This function accepts a single parameter $channel_type which holds the channel constant that is vali 2 min read Like