相关疑难解决方法(0)

PHP/GD:更好的高斯模糊

我想用GD库模糊图像,遗憾的是GD给出的GAUSSIAN_BLUR效果还不够,我想要的东西更模糊

<?php $im = imagecreatefrompng($_GET['image']);
if($im && imagefilter($im, IMG_FILTER_GAUSSIAN_BLUR))
{
  header('Content-Type: image/png');
    imagepng($im);
}
else
{
    echo 'fail';
}

imagedestroy($im);
Run Code Online (Sandbox Code Playgroud)

我想要这样的东西或至少在它附近. 来自//tutorial9.s3.amazonaws.com/uploads/2008/06/lens-blur.jpg的图片

php gd blur imagefilter

14
推荐指数
2
解决办法
2万
查看次数

PHPb实现的stackblur算法可用吗?

我试图模糊图像,需要更快的解决方案.

这是我目前的尝试,对于大型图像而言太慢了,我不想使用想象力.

public function blur($filename, $extension, $factor = 20){
    if (strtolower($extension) === "jpg" || strtolower($extension) === "jpeg") $image = imagecreatefromjpeg($filename);
    if (strtolower($extension) === "png") $image = imagecreatefrompng($filename);

    for ($x=1; $x<=$factor; $x++)
       imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
    imagejpeg($image, "$filename.blur.$extension");
    imagedestroy($image);

}
Run Code Online (Sandbox Code Playgroud)

是否有可用的stackblur或其他快速算法的PHP实现?

php algorithm image-processing

2
推荐指数
1
解决办法
2715
查看次数

标签 统计

php ×2

algorithm ×1

blur ×1

gd ×1

image-processing ×1

imagefilter ×1