imagegammacorrect

(PHP 4, PHP 5, PHP 7)

imagegammacorrectApply a gamma correction to a GD image

Description

imagegammacorrect ( resource $image , float $inputgamma , float $outputgamma ) : bool

Applies gamma correction to the given gd image given an input and an output gamma.

Parameters

image

An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().

inputgamma

The input gamma.

outputgamma

The output gamma.

Return Values

Returns true on success or false on failure.

Examples

Example #1 imagegammacorrect() usage

<?php
// Create image instance
$im = imagecreatefromgif('php.gif');

// Correct gamma, out = 1.537
imagegammacorrect($im, 1.0, 1.537);

// Save and free image
imagegif($im, './php_gamma_corrected.gif');
imagedestroy($im);
?>

© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.imagegammacorrect.php