1

I have implemented the ability to blur images in my iOS app using the pinch gesture, however I would like to implement a circular white overlay that is commonly used as a reference point with the pinch gesture so that the user can adjust the amount of blur. Just like the image below:

Sample White Pinch Gesture Overlay

The image above was from: https://media.tumblr.com/tumblr_lutwauVUW31qm4rc3.png

How can I implement this feature?

Thanks!

Community
  • 1
  • 1
deadlock
  • 7,048
  • 14
  • 67
  • 115

2 Answers2

1

GaussianSelectiveBlurFilter in GPUImage lib may be help yo a lot. well,here is the github source.

I think it is not hard to use, hope you will enjoy it.

yijiankaka
  • 128
  • 3
0

You can use a GPUImageVignetteFilter, and set the vignette color to white.

I'm guessing you're implementing the blur with GPUImageGaussianSelectiveBlurFilter within GPUImage (because I see you tagged GPUImage in your question). If you are, you'll notice that the properties on GPUImageGaussianSelectiveBlurFilter don't exactly translate over to GPUImageVignetteFilter, so you'll have to do a bit of math to translate to a new "coordinate" system, but it's fairly trivial.

kev
  • 7,712
  • 11
  • 30
  • 41