Bitmap color channel blending

he red channel image is very light (almost white) on the parrot’s body, since it is very red, but the green and blue channel images are almost black in that area.

quite powerful built-in capabilities of Paint.

BitmapFactory.Options object 

Any time you want to do image blending or color manipulation, you need to make sure you are in ARGB_8888 modenot in RGB_565 mode. Up until 2.3, android will usually default to RGB_565 mode unless you explicitly tell it to do otherwise in order to save memory.

private Bitmap getARGBImage()
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Config.ARGB_8888;

Bitmap red = BitmapFactory.decodeResource(getResources(),, opt);
Bitmap green = BitmapFactory.decodeResource(getResources(),, opt);
Bitmap blue = BitmapFactory.decodeResource(getResources(),, opt);

int width = red.getWidth();
int height = red.getHeight();

Bitmap result = Bitmap.createBitmap(width, height, Config.ARGB_8888);

// We will do more here…

return result;


Android Bitmap Blending – Color Channels

set the Xfermode of the Paint to a PorterDuffXfermode With the Screen mode, black areas become transparent, and light areas are generally lightened.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Just another site

Jing's Blog

Just another site

Start from here......







Just another site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision


Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness



Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: