note 45391 added to function.imagefilter
| From: | vdepizzol at hotmail dot com | Date: | Sat, 04 Sep 2004 20:36:16 +0000 |
| Subject: | note 45391 added to function.imagefilter | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76019@lists.php.net to get a copy of this message | ||
Examples using imagefilter():
<?php
$im = imagecreatefrompng('dave.png');
if ($im && imagefilter($im, IMG_FILTER_GRAYSCALE)) {
echo 'Image converted to grayscale.';
imagepng($im, 'dave.png');
} else {
echo 'Conversion to grayscale failed.';
}
imagedestroy($im);
?>
/////////////////////////////
<?php
$im = imagecreatefrompng('sean.png');
if ($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 20)) {
echo 'Image brightness changed.';
imagepng($im, 'sean.png');
} else {
echo 'Image brightness change failed.';
}
imagedestroy($im);
?>
/////////////////////////////
<?php
$im = imagecreatefrompng('philip.png');
/* R, G, B, so 0, 255, 0 is green */
if ($im && imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0)) {
echo 'Image successfully shaded green.';
imagepng($im, 'philip.png');
} else {
echo 'Green shading failed.';
}
imagedestroy($im);
?>
----
Manual Page -- http://www.php.net/manual/en/function.imagefilter.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45391
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45391&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45391&report=yes
Search -- http://master.php.net/manage/user-notes.php