Blur and emboss image

I am working on an android application and I have a shortcut that I load from the original image. In this image I want to do image blur and embed, I read How do I change the colors of Drawable in Android?

Can you give me some advice? thanks

edit: I have an embos image, but I cannot blue image, can you give me blue

+2
source share
3 answers
public Bitmap fudiao(Bitmap bmpOriginal) { int width, height, r,g, b, c,a, gry,c1,a1,r1,g1,b1,red,green,blue; height = bmpOriginal.getHeight(); width = bmpOriginal.getWidth(); int depth = 30; Bitmap bmpSephia = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); Canvas canvas = new Canvas(bmpSephia); Paint paint = new Paint(); // ColorMatrix cm = new ColorMatrix(); // cm.setScale(.3f, .3f, .3f, 1.0f); // ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm); // paint.setColorFilter(f); canvas.drawBitmap(bmpOriginal, 0, 0, null); for(int y=1; y< height-1; y++) { for(int x=1; x < width-1; x++) { c = bmpOriginal.getPixel(x, y); r = Color.red(c); g = Color.green(c); b = Color.blue(c); c1 = bmpOriginal.getPixel(x-1, y-1); r1 = Color.red(c1); g1 = Color.green(c1); b1 = Color.blue(c1); red = Math.max(67, Math.min(255, Math.abs(r - r1 + 128))); green = Math.max(67, Math.min(255, Math.abs(g - g1 + 128))); blue = Math.max(67, Math.min(255, Math.abs(b - b1 + 128))); if (red > 255) { red = 255; } else if (red < 0) { red = 0; } if (green > 255) { green = 255; } else if (green < 0) { green = 0; } if (blue > 255) { blue = 255; } else if (blue < 0) { blue = 0; } bmpSephia.setPixel(x, y, Color.rgb(red, green, blue)); // bmpSephia.setPixel(x, y, Color.argb(a1, red, green, blue)); } } return bmpSephia; } 

it's only pic embossing

+2
source

I think you are probably looking for something like this: http://code.google.com/p/jjil/

+1
source
 paint.setColorFilter( <LightingColorFilter> ); 
0
source

Source: https://habr.com/ru/post/906821/


All Articles