如何在iPhone中的图像上赋予素描效果? [英] How to give sketch effect on image in iphone?

查看:112
本文介绍了如何在iPhone中的图像上赋予素描效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现一个iPhone应用程序,其中已经实现了以下功能:

I am implementing an iPhone application, in which I have implemented the following functionalities:

  1. 选择照片
  2. 捕获照片
  3. 现在,我想为该照片提供素描效果,例如我该怎么办?

    推荐答案

    如果我可能再次推荐它,那么我的开源

    If I may once again recommend it, my open source GPUImage framework has a built in filter that does just this. The GPUImageSketchFilter uses Sobel edge detection to highlight edges in black on images or video, leading to the exact same effect as seen in that application:

    上面的图片来自此答案,其中我描述了该过滤器的工作原理,并展示了一些其他过滤器示例.

    The above image was drawn from this answer, where I describe how that filter works, as well as show a couple other filter examples.

    实际上,框架随附的SimplePhotoFilter示例应用程序完全按照您的描述进行操作(捕获照片,对其应用草图过滤器,然后将其保存到照片库中),因此,如果需要,我将从此处开始使其快速启动并运行.

    In fact, the SimplePhotoFilter example application that comes with the framework does exactly what you describe (capture a photo, apply a sketch filter to it, and save it to the photo library), so I'd start there if you want to get this up and running quickly.

    这篇关于如何在iPhone中的图像上赋予素描效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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