Open In App

PHP | Imagick getImageChannelKurtosis() Function

Last Updated : 19 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The Imagick::getImageChannelKurtosis() function is an inbuilt function in PHP which is used to get the kurtosis and skewness of a specific channel.

Syntax:

array Imagick::getImageChannelKurtosis( int $channel )

Parameters: This function accepts a single parameter $channel which is used to specify the channel constant that is valid for your channel mode. You can combine channel-type constants using bitwise operators if you want to apply to more than one channel. Default’s value is Imagick:: CHANNEL_DEFAULT.

Exceptions: This function throws ImagickException on error.

Return Value: This function returns an array with kurtosis and skewness members.

Below programs illustrate the Imagick::getImageChannelKurtosis() function in PHP:

Program 1:




<?php
  
// Create two new imagick object
$imagick1 = new Imagick(
  
// Get the Kurtosis and Skewness
$kurtosis = $imagick1->getImageChannelKurtosis();
  
print_r($kurtosis);
?>


Output:

Array ( [kurtosis] => 3.4855489191387 [skewness] => -2.2453954888518 )

Program 2:




<?php
  
// Create new imagick object
$imagick = new Imagick(
  
// Get the Kurtosis and Skewness with CHANNEL constant as 6
// which corresponds to imagick::CHANNEL_BLUE
$kurtosis = $imagick->getImageChannelKurtosis(6);
  
print_r($kurtosis);
?>


Output:

Array ( [kurtosis] => 17.803640811167 [skewness] => -4.0753636831512 )

Reference: https://www.php.net/manual/en/imagick.getimagechannelkurtosis.php


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads