php imagemagick statistics usage
Posted: 2013-10-27T01:21:32-07:00
Hello
I'm trying to compute the average brightness of an image using Imagemagick's getImageChannelStatistics function. I will then use modulateImage to decrease the brightness if it reaches a given threshold.
1st question: The returned mean value of each channel is greater than 255, although the color depth is 8. How to interpret these values ?
2nd question: What is the relation between the mean value and brightness of an image ?
I'm trying to compute the average brightness of an image using Imagemagick's getImageChannelStatistics function. I will then use modulateImage to decrease the brightness if it reaches a given threshold.
Code: Select all
array Imagick::getImageChannelStatistics ( void )
Code: Select all
Array ( [mean] => 27510.293108724 [minima] => 0 [maxima] => 65535 [standardDeviation] => 23761.909802897 [depth] => 8 )
Array ( [mean] => 22654.046931424 [minima] => 0 [maxima] => 65535 [standardDeviation] => 21085.309916751 [depth] => 8 )
Array ( [mean] => 21137.418988715 [minima] => 0 [maxima] => 65535 [standardDeviation] => 20369.810455127 [depth] => 8 )
Code: Select all
bool Imagick::modulateImage ( float $brightness , float $saturation , float $hue )