Android Utililty Methods Bitmap Blur

List of utility methods to do Bitmap Blur

Description

The list of methods to do Bitmap Blur are organized into topic(s).

Method

Bitmapblur(Bitmap bitmap)
blur
int iterations = 1;
int radius = 8;
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] inPixels = new int[width * height];
int[] outPixels = new int[width * height];
Bitmap blured = Bitmap.createBitmap(width, height,
        Bitmap.Config.ARGB_8888);
...
voidblur(int[] in, int[] out, int width, int height, int radius)
blur
int widthMinus1 = width - 1;
int tableSize = 2 * radius + 1;
int divide[] = new int[256 * tableSize];
for (int index = 0; index < 256 * tableSize; index++) {
    divide[index] = index / tableSize;
int inIndex = 0;
for (int y = 0; y < height; y++) {
...
BitmapcreateBlurredBitmap(final Bitmap sentBitmap)
Takes a bitmap and creates a new slightly blurry version of it.
if (sentBitmap == null) {
    return null;
final Bitmap mBitmap = sentBitmap
        .copy(sentBitmap.getConfig(), true);
final int w = mBitmap.getWidth();
final int h = mBitmap.getHeight();
final int[] pix = new int[w * h];
...
Bitmapfastblur(Bitmap sentBitmap)
Fastblur.
int[] radius = new int[] { 1, 2, 3, 6 };
int[] ellipseWidth = new int[] { 6, 4, 3, 2 };
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
int w = bitmap.getWidth();
int h = bitmap.getHeight();
int[] pix = new int[w * h];
final int width = sentBitmap.getWidth();
final int height = sentBitmap.getHeight();
...
Bitmapfastblur(Bitmap sentBitmap, int radius)
Fastblur in bitmap.
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
Bitmap origBitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
if (radius < 1) {
    return (null);
int w = bitmap.getWidth();
int h = bitmap.getHeight();
int[] pix = new int[w * h];
...
Bitmapblur(Context context, Bitmap sentBitmap)
blur
return blur(context, sentBitmap, BLUR_RADIUS);
Bitmapblur(Context context, Bitmap sentBitmap, int radius)
blur
Bitmap bitmap = Bitmap.createScaledBitmap(sentBitmap,
        sentBitmap.getWidth() / 2, sentBitmap.getHeight() / 2,
        false);
if (VERSION.SDK_INT > 16) {
    final RenderScript rs = RenderScript.create(context);
    final Allocation input = Allocation.createFromBitmap(rs,
            bitmap, Allocation.MipmapControl.MIPMAP_NONE,
            Allocation.USAGE_SCRIPT);
...
BitmapfastBlurFromView(Context context, View v, int radius)
fast Blur From View
return fastBlur(context, loadBitmapFromView(v), radius);
BitmapfastBlur(Context context, Bitmap renderedBmp, int radius)
fast Blur
if (VERSION.SDK_INT > 16) {
    Bitmap bitmap = renderedBmp.copy(renderedBmp.getConfig(), true);
    final RenderScript rs = RenderScript.create(context);
    final Allocation input = Allocation.createFromBitmap(rs,
            renderedBmp, Allocation.MipmapControl.MIPMAP_NONE,
            Allocation.USAGE_SCRIPT);
    final Allocation output = Allocation.createTyped(rs,
            input.getType());
...
voidblurFractional(int[] in, int[] out, int width, int height, float radius)
blur Fractional
radius -= (int) radius;
float f = 1.0f / (1 + 2 * radius);
int inIndex = 0;
for (int y = 0; y < height; y++) {
    int outIndex = y;
    out[outIndex] = in[0];
    outIndex += height;
    for (int x = 1; x < width - 1; x++) {
...