Change brightness in PHP

Description

The following code shows how to change brightness.

Example


// w  w w .  j a v a2  s. c o  m

<?php
$im = imagecreatefrompng('test.png');

if($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 20))
{
    echo 'Image brightness changed.';

    imagepng($im, 'test.png');
    imagedestroy($im);
}
else
{
    echo 'Image brightness change failed.';
}
?>

The code above generates the following result.

Change brightness in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text