I want to Remove blur for specific where user Touch on the screen. When User Move his finger on the screen Only current touch part will have clear Image. Rest all screen will have blur Image. And when user remove his finger from the screen complete image will be blur again.
What I have done so far is: Added a GPUImage Framework to make an Image blur. On the top of that Image I have one original image. That is hide initially. What I want is when user Tap on the screen then display original image for that selected part only with the particular Circle.
Thanks
Interface builder
UIImageView
over each other. Set both their modes toAspect Fit
. On theUIImageView
you want to blur, also checkUser Interaction Enabled
.Make sure to set the spacing to nearest neighbour constrains of the
UIImageView
you DO want to blur to -10, and the spacing to nearest neighbour constrains of theUIImageView
you DON'T want to blur to 0.We do this because later we apply a
GaussianBlurFilter
of 10. By applying this filter we add 10 extra pixels in each direction of the image we are going to blur, making the image 20 pixels bigger in height and width. Also make sure to checkClip Subviews
in your super view, to prevent the blurred image from going outside it's super view's bounds..h File
In your .h declare the
UIImageView
you want to blur by ctrl+click dragging it to the .h file. Your .h file should look something like this:.m File
In your .m file
@synthesize
uivBlurred, and declare the following 2 methods:and
Also implement the following 3 methods in your .m file:
Add the following line to your viewDidLoad
[self blurImageInImageView:uivBlurred];
Now add your image, and run the app. You should have something like this:
And when you click on the image:
You can also download a sample project with the above code here