PHP GD Set image brightness


 

PHP GD Set image brightness

This example shows how to set brightness of an image in php gd.

This example shows how to set brightness of an image in php gd.

<?php

$im = imagecreatefromjpeg('brightness.jpg');

 

if($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 100))

{

echo 'Image brightness changed.';

 

imagejpeg($im, 'brightness.jpg');

imagedestroy($im);

}

else

{

echo 'Image brightness change failed.';

}

?>

After running the program you will get the following output

Ads