iOS: How to efficiently blur an image?

被刻印的时光 ゝ 提交于 2019-12-25 03:22:38

问题


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?


回答1:


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

  1. Use the CILanczosScaleTransform filter to scale-down your image.
  2. Perform a low-radius blur using CIGaussianBlur.
  3. Use CILanczosScaleTransform to scale-up your image.


来源:https://stackoverflow.com/questions/28710332/ios-how-to-efficiently-blur-an-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!