3

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

  1. Select photo
  2. Capture photo
  3. Now I want to give a sketch effect to that photo like this one.

How could I do this?

j0k
  • 22,600
  • 28
  • 79
  • 90
ManthanDalal
  • 1,063
  • 2
  • 20
  • 45

3 Answers3

6

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:

Sketch filter

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

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.

Community
  • 1
  • 1
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
1

OpenCV can be used to give sketch effect on image in iphone.

Refer iphone-how-to-convert-a-photo-into-a-pencil-drawing link and get helped.

Community
  • 1
  • 1
Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
0

Core Image filters are probably the best way to go.

http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CoreImageFilterReference/.

Jonathan King
  • 1,528
  • 14
  • 25
  • 1
    Unfortunately, that documentation was copied and pasted from the Mac documentation on Core Image and those filters aren't included in Core Image on iOS as of 5.1: http://stackoverflow.com/q/8528726/19679 – Brad Larson Aug 09 '12 at 17:35
  • Just checked, and yes you are correct, I copied them from the Apple wiget. – Jonathan King Aug 09 '12 at 17:37
  • Yeah, it's unfortunate that the documentation is a little out of sync with what's actually there on the device. I should probably file an enhancement request on that. The lack of these filters is one of the reasons I wrote the framework in my answer. – Brad Larson Aug 09 '12 at 17:46