However, I do suggest you do not implement this in Java, which is very slow. Rather do this on RenderScript, which is a Google technology designed for this type of missions – a cross architecture, highly optimized C code to handle graphic tasks and image manipulation.
If you don’t like the color you are getting from the average of the color values, you could try Android’s Palette class. The class was made to generate a palette of colors based on the prominent colors of an image to create something like this:
This would have to be done asynchronously from the UI thread:
Palette.from(bitmap).generate(new PaletteAsyncListener() {
public void onGenerated(Palette palette) {
// Use generated palette
}
});
You can try the different methods available from the Palette class (i.e. getVibrantColor, getMutedColor, getDarkVibrantColor, etc.) to see which returns values you like.
3
Answers
you can use this library to make blur any background or image https://github.com/faradaj/BlurBehind
An interesting question. And the answer is not a straight forward one.
If you don’t like the color you are getting from the average of the color values, you could try Android’s
Palette
class. The class was made to generate a palette of colors based on the prominent colors of an image to create something like this:This would have to be done asynchronously from the UI thread:
You can try the different methods available from the
Palette
class (i.e.getVibrantColor
,getMutedColor
,getDarkVibrantColor
, etc.) to see which returns values you like.