PHP锐度卷积矩阵

时间:2010-08-27 22:45:06

标签: php image matrix gd convolution

我在 PHP GD 中使用 convolution matrix 表示清晰度,我想更改清晰度“级别”

如果我想让更多或更不敏锐,我会对此进行更改

$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);

2 个答案:

答案 0 :(得分:2)

尝试查看http://www.gamedev.net/reference/programming/features/imageproc/page2.asp

网上有很多例子,但根据经验,您可以先在GIMP或PS或任何其他具有此功能的编辑器中尝试这些参数(图像卷积很常见)

答案 1 :(得分:2)

你真正需要做的是使用这个公式

其中k =锐度水平。

相关问题