Crawler Crawler - 1 month ago 5
Android Question

Difference between image formats RGB888 and ARGB8888

I'm new to image processing and game development. I was following a tutorial in which it suggest to use background image of format

RGB888
and for sprites, buttons and other rest icons it suggest to use
ARGB8888
format.

Most basic difference is there Bits
RGB888
is 24bit and
ARGB8888
is 32 bit.

So I want to know what is real difference between these two format and how they effect in visual representation?

Answer

More detail on the colour space on Wikipedia and more information on bitmaps on Android Developers Documentation. A lpha, R ed, G reen and B lue channels are represented. The alpha channel denotes the level of transparency in the image. The '8' in the name refers to the number of bits per channel. So RGB is 8+8+8= 24 bits, and ARGB is 8+8+8+8 = 32 bits.

Drawing in RGB will allow you to choose the colour of the image for either, RGB888 assumes an alpha value of 255. Adding the Alpha value by using ARGB8888 will allow you to set the transparency yourself with a number between 0 (fully transparent) and 255 (fully opaque). An example of adding transparency badly to a menu in Android would be something like the image below:

Comments