List of utility methods to do Bitmap Color Change
Bitmap | toGrayscale(Bitmap bmpOriginal) to Grayscale int width, height; height = bmpOriginal.getHeight(); width = bmpOriginal.getWidth(); Bitmap bmpGrayscale = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); Canvas c = new Canvas(bmpGrayscale); Paint paint = new Paint(); ColorMatrix cm = new ColorMatrix(); ... |
Bitmap | toGrayscale(Bitmap bmpOriginal, int pixels) to Grayscale return toRoundCorner(toGrayscale(bmpOriginal), pixels);
|
Bitmap | createMaskBitmap(Bitmap src, Resources resource, int mask) create Mask Bitmap Bitmap maskMap = BitmapFactory.decodeResource(resource, mask).copy( Bitmap.Config.ARGB_8888, true); Canvas canvas = new Canvas(maskMap); if (null != src) { canvas.scale( (float) maskMap.getWidth() / (float) src.getWidth(), (float) maskMap.getHeight() / (float) src.getHeight()); Paint paint = new Paint(); ... |
BufferedImage | createTranslucentCompatibleImage(int width, int height) create Translucent Compatible Image return getGraphicsConfiguration().createCompatibleImage(width,
height, Transparency.TRANSLUCENT);
|