I have an imageview and i set Image Resources programmatically like this:
int resourceId = getResources().getIdentifier(\"imagename\", \"drawable\", \"mypack
Just simply use this library https://github.com/ChathuraHettiarachchi/BlurIM , I was having problem with BlurTransformation class had errors thats why couldn't use Glide transformation but this works fine.
BlurImage.withContext(this)
.blurFromResource(R.drawable.YOUR_RESOURCE)
.into(imageView);
You can use RenderScript to accomblish that as explained here or you can use the stackblur library to make a blurring effect in your image.
Usage of the stackblur library:
int resourceId = getResources().getIdentifier("imagename", "drawable", "mypackage");
// get bitmap from resource id
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resourceId);
StackBlurManager stackBlurManager = new StackBlurManager(bitmap);
// process the image using a certain radius
stackBlurManager.process(progress*4);
// obtain the image and load it into an ImageView or any other component
imgLock.setImageBitmap(stackBlurManager.returnBlurredImage());
There's the library that can use RenderScript so a blurring is blazingly fast and super easy to use:
<ru.egslava.blurredview.BlurredImageView
...
android:src="@drawable/..."
app:radius="0.3"
app:keepOriginal="true"
app:downSampling="2" />
You can use glide transformations https://github.com/wasabeef/glide-transformations you can blur the image with one line of code
Glide.with(this).load(R.drawable.demo)
.bitmapTransform(new BlurTransformation(context))
.into((ImageView) findViewById(R.id.image));