0

I am trying to implement a feature in the app that blurs some part of an image based on users selection/touch. I have suceessfully applied the Android's "RenderScript" method to blur full image however, I can't find an example of blurring only some part of an image.

If anyone can point me to a right direction, that would be great.

I used code from following question to achive full image blur. https://stackoverflow.com/a/21052060/1293053

Community
  • 1
  • 1
Sahil
  • 1,959
  • 6
  • 24
  • 44

3 Answers3

4

You can use forEach(Allocation aout, Script.LaunchOptions opt) of ScriptIntrinsicBlur with an appropriate opt value to set the rectangle you want to blur. http://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlur.html has the description.

Stephen Hines
  • 2,612
  • 1
  • 13
  • 12
1

You can use paint and blur parts of your canvas. There are some links which can be help to you :

Blur on touch. Android application

Is it possible to blur part of image on touch in Android?

Android draw with blur

Hope this helps.

Community
  • 1
  • 1
Sushil
  • 8,250
  • 3
  • 39
  • 71
-1

Try using this library: https://github.com/jrvansuita/GaussianBlur

//Asynchronous with scaleDown and changing radius
GaussianBlur.with(context).size(300).radius(10).put(R.mipmap.your_image, imageView);
Vansuita Jr.
  • 1,949
  • 17
  • 18