-5

I have an imageView and want to apply a filter so that it becomes blurred, I use android studio and the version min of sdk is 17, help me to achieve this task

3 Answers3

0

I think you can use setAlpha() method.

Like imageView.setAlpha(floatValue);

"floatValue" ranges from 0 to 1.

Try values below 1 for your purpose.

John.B
  • 1
  • 1
0

Read about/Google "Convolution Filters", it's a method of changing a pixels value based on the values of pixels around it. So apart from blurring, you can also do image sharpening and line-finding.

How do I blur an image?

If your question is how to blur so you can use that

imageview = (ImageView) itemView.findViewById(R.id.imageView);

BitmapDrawable drawable = (BitmapDrawable) imageview.getDrawable();
Bitmap bitmap = drawable.getBitmap();
Bitmap blurred = blurRenderScript(bitmap, radiusArr[position]);//second parametre is radius
imageview.setImageBitmap(blurred);

for more reference you can refer this url https://github.com/Cutta/Simple-Image-Blur

Community
  • 1
  • 1
Shubhank Gupta
  • 833
  • 2
  • 15
  • 35
0

Use Picasso - Square library

And apply the Picasso Blur Transformation

This is easier than trying to re-invent the wheel.

Viral Patel
  • 32,418
  • 18
  • 82
  • 110