Syntax:bool Imagick::setImageGamma (float $gamma)
Parameters:This function takes one parameter
$gamma,which contains the gamma for the image.
Return value:This function returns TRUE on success.
Exceptions:This function will throw an ImagickException on error.The programs below illustrate the
Imagick::setImageGamma() function in PHP:
Program 1:
// Create a new imagick object
$imagick
=
new
Imagick ( ’ https://media.engineerforengineer.org/wp-content /uploads/engineerforengineer-13.png ’
);
// Set gamma
$imagick
-> setImageGamma (5);
// Show image
header (
"Content-Type: image / png"
);
echo
$imagick
-> getImageBlob();
?>
Output: Program 2: < tbody>
// Create a new imagick object
$imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/ wp-content / uploads / engineerforengineer-13.png ’
);
// Set gamma
$imagick
-> setImageGamma (15);
// Add border
$imagick
-> borderImage (
’black’
, 2, 2);
// Show image
header (
"Content-Type: image / png"
);
echo
$imagick
-> getImageBlob();
?>
Output: Link : https://www.php.net/manual/en/imagick.setimagegamma.php