$rgb = imagecolorat($im_org, $i, $j);
$rr = ($rgb >> 16) & 0xFF;
$gg = ($rgb >> 8) & 0xFF;
$bb = $rgb & 0xFF;
$g = round(($rr + $gg + $bb) / 3);
$val = imagecolorallocate($im_org, $g, $g, $g);
imagesetpixel ($im_org, $i, $j, $val);这就是我如何灰度化图片,简单地通过设置每个像素。然而,我想调整灰度输出的方式,比如我想添加更多的对比度和东西。我该怎么做呢?
发布于 2013-08-21 23:45:46
那imagefilter($img, IMG_FILTER_GRAYSCALE);呢?
https://stackoverflow.com/questions/18361840
复制相似问题