PHP | Imagick getImageChannelMean() Function Last Updated : 03 Feb, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 $channel) Parameters: This function accepts a single parameter $channel which holds the channel constant that is valid for your channel mode. Use bitwise operator to combine more than one channeltype constants. Exceptions: This function throws ImagickException on error. Return Value: This function returns TRUE on success. Below programs illustrate the Imagick::getImageChannelMean() function in PHP: Program 1: php <?php // Create new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Get the mean with CHANNEL constant as 1 // which corresponds to imagick::CHANNEL_RED $mean = $imagick->getImageChannelMean(1); print_r($mean); ?> Output: Array( [mean] => 56510.812968516 [standardDeviation] => 20404.259764873 ) Program 2: php <?php // Create new imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Get the mean with CHANNEL constant as 5 // which corresponds to imagick::CHANNEL_MAGENTA $mean = $imagick->getImageChannelMean(5); print_r($mean); ?> Output: Array ( [mean] => 57217.085522456 [standardDeviation] => 18896.296535248 ) Reference: https://www.php.net/manual/en/imagick.getimagechannelmean.php Comment More infoAdvertise with us Next Article PHP | Imagick getImageChannelStatistics() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick getImageChannelRange() Function 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 defa 2 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 | Imagick getImageChannelStatistics() Function The Imagick::getImageChannelStatistics() function is an inbuilt function in PHP which is used to get the statistics for each channel in the image. Syntax: array Imagick::getImageChannelStatistics( void ) Parameters: This function does not accept any parameters. Exceptions: This function throws Imagi 2 min read PHP | Imagick getImageChannelDistortion() Function The Imagick::getImageChannelDistortion() function is an inbuilt function in PHP which is used to compare image channels of an image to a reconstructed image and returns the specified distortion metric. Syntax: float Imagick::getImageChannelDistortion( Imagick $reference, int $channel, int $metric ) 2 min read Like