PHP | Imagick setImageGamma() Function
Last Updated :
19 Nov, 2019
The Imagick::setImageGamma() function is an inbuilt function in PHP which is used to set the image gamma.
Syntax:
bool Imagick::setImageGamma( float $gamma )
Parameters: This function accepts a single parameter $gamma which holds the gamma for the image.
Return Value: This function returns TRUE on success.
Exceptions: This function throws ImagickException on error.
Below given programs illustrate the Imagick::setImageGamma() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$imagick ->setImageGamma(5);
header( "Content-Type: image/png" );
echo $imagick ->getImageBlob();
?>
|
Output:
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setImageGamma(15);
$imagick ->borderImage( 'black' , 2, 2);
header( "Content-Type: image/png" );
echo $imagick ->getImageBlob();
?>
|
Output:
Reference: https://www.php.net/manual/en/imagick.setimagegamma.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...