android - blur and emboss an image -



android - blur and emboss an image -

i'm working on android application, , have drawable i'm loading source image. on image want create image blur , embross ,i have read how alter colors of drawable in android?

can give me advice?thank you

edit:i have emboss image,but cannot bluish image,can give me blue

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); reddish = math.max(67, math.min(255, math.abs(r - r1 + 128))); greenish = math.max(67, math.min(255, math.abs(g - g1 + 128))); bluish = math.max(67, math.min(255, math.abs(b - b1 + 128))); if (red > 255) { reddish = 255; } else if (red < 0) { reddish = 0; } if (green > 255) { greenish = 255; } else if (green < 0) { greenish = 0; } if (blue > 255) { bluish = 255; } else if (blue < 0) { bluish = 0; } bmpsephia.setpixel(x, y, color.rgb(red, green, blue)); // bmpsephia.setpixel(x, y, color.argb(a1, red, green, blue)); } } homecoming bmpsephia; }

this emboss pic

android image colors

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -