note 18462 added to function.imagecreatetruecolor
| From: | rossa at studioware dot net | Date: | Thu, 24 Jan 2002 00:38:15 +0000 |
| Subject: | note 18462 added to function.imagecreatetruecolor | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25765@lists.php.net to get a copy of this message | ||
function ConvertGreyscale($image){
# this file outputs a grey version of specified image
$total = ImageColorsTotal($image);
for( $i=0; $i<$total; $i++){
$old = ImageColorsForIndex($image, $i);
#trying to keep proper saturation when converting
$commongrey = (int)(($old[red] + $old[green] + $old[blue]) / 3);
ImageColorSet($image, $i, $commongrey, $commongrey, $commongrey);
}
}
--
http://www.php.net/manual/en/function.imagecreatetruecolor.php
http://master.php.net/manage/user-notes.php?action=edit+18462
http://master.php.net/manage/user-notes.php?action=delete+18462
http://master.php.net/manage/user-notes.php?action=reject+18462