我正在寻找一种 比使用 GaussianBlur 更快地模糊 图像的方法。
解决方案 我正在寻找 可以是命令行解决方案 ,但我更喜欢 perl 表示法的代码。
实际上,我们使用Perl image magick API来模糊图像:
# $image is our Perl object holding a imagemagick perl image
# level is a natural number between 1 and 10
$image->GaussianBlur('x' . $level);
这工作正常,但随着关卡高度的增加,它消耗的时间似乎呈指数增长。
问题:如何改善模糊操作所用的时间?
是否有另一种更快的方法来模糊图像?
最佳答案
documentation speaks of the difference between Blur and GaussianBlur。
那将是:
$image->Blur( 'x' . $level );
但是 Perl ImageMagick documentation 在
Blur
和 GaussianBlur
上有相同的文本(重点是我的)。我现在无法尝试,您必须自己进行基准测试。alternative that the documentation also lists正在将图像调整为非常小的尺寸,然后再次放大。
示例命令行代码是这样的: