Android Utililty Methods Bitmap Color Change

List of utility methods to do Bitmap Color Change

Description

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

Method

BitmaptoGrayscale(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();
...
BitmaptoGrayscale(Bitmap bmpOriginal, int pixels)
to Grayscale
return toRoundCorner(toGrayscale(bmpOriginal), pixels);
BitmapcreateMaskBitmap(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();
...
BufferedImagecreateTranslucentCompatibleImage(int width, int height)
create Translucent Compatible Image
return getGraphicsConfiguration().createCompatibleImage(width,
        height, Transparency.TRANSLUCENT);