close
簡單的函數為灰度圖像
function imagecolorgrey( &$img ) {
for( $i=0; $i<imagecolorstotal( $img ); $i++ ) {
$c = ImageColorsForIndex( $img, $i );
$t = ($c["red"]+$c["green"]+$c["blue"])/3;
imagecolorset( $img, $i, $t, $t, $t );
}
}
全站熱搜