iOS:如何有效地模糊图像? [英] iOS: How to efficiently blur an image?

查看:92
本文介绍了iOS:如何有效地模糊图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图像,该图像以RGBA格式存储在内存中。我编写了一个模糊例程,该例程对于较小的模糊半径可以很好地工作,但是像16点这样的大半径将永远消失。是否有使用CoreImage等使图像模糊的有效方法?使用它会导致图像质量下降吗?

I have an image that is stored a RGBA format in memory. I've written a blur routine that works fine for small blur radii, however big ones like 16 point take forever. Is there an efficient way using CoreImage etc to blur an image? Will using it cause any loss in image quality?

推荐答案

您是否尝试过内置CIGaussianBlur?您可以采取以下措施来提高性能:

Have you tried the built-in CIGaussianBlur? One thing you could do to improve your performance is the following:


  1. 使用CILanczosScaleTransform过滤器缩小图像。

  2. 使用CIGaussianBlur执行低半径模糊。

  3. 使用CILanczosScaleTransform放大图像。

这篇关于iOS:如何有效地模糊图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆