开发者

PHP sharpness convolution martix

开发者 https://www.devze.com 2023-01-13 05:04 出处:网络
I\'m using a convolution matrix for sharpness in PHP GD and I want to change the开发者_StackOverflow sharpness \"level\".

I'm using a convolution matrix for sharpness in PHP GD and I want to change the开发者_StackOverflow sharpness "level".

Where would I make changes to this if I want to make it more or less sharp?

$image = imagecreatefromjpeg('pic.jpg');

$matrix = array(
  array(0, -1, 0), 
  array(-1, 5, -1), 
  array(0, -1, 0)
);

imageconvolution($image, $matrix, 1, 0.001);
header("Content-type: image/jpeg");
imagejpeg($image);


try looking on http://www.gamedev.net/reference/programming/features/imageproc/page2.asp

There are lots of examples on the web, but as a rule of thumb you may try these params first in GIMP or PS or any other editor that has this function (image convolution is pretty common)


What you really needed to do was use this formula

PHP sharpness convolution martix

Where k = sharpness level.

0

精彩评论

暂无评论...
验证码 换一张
取 消