PHP | Gmagick getimagegamma() Function
Last Updated :
21 Jan, 2020
The Gmagick::getimagegamma() function is an inbuilt function in PHP which is used to get the image gamma. The Gamma is a nonlinear operation used to encode and decode luminance or tristimulus values in images.
Syntax:
float Gmagick::getimagegamma( void )
Parameters: This function doesn’t accept any parameter.
Return Value: This function returns an float value containing the gamma.
Exceptions: This function throws GmagickException on error.
Below given programs illustrate the Gmagick::getimagegamma() function in PHP:
Program 1 (For image with multiple colors):
<?php
$gmagick = new Gmagick( 'geeksforgeeks.png' );
$gamma = $gmagick ->getimagegamma();
echo $gamma ;
?>
|
Output:
0.45454999804497
Program 2 (For image with single color):
<?php
$gmagick = new Gmagick( 'singlecolor.png' );
$gamma = $gmagick ->getimagegamma();
echo $gamma ;
?>
|
Output:
0
Reference: https://www.php.net/manual/en/gmagick.getimagegamma.php
Share your thoughts in the comments
Please Login to comment...