Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 RGB888and 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?

like image 922
Crawler Avatar asked Sep 25 '14 07:09

Crawler


People also ask

What format is RGB888?

RGB888. In TouchGFX, a color of 24 bpp color depth will have the color format RGB888. This means that 8 bits are used for each of the color components red, green and blue.

What is ARGB_ 8888?

public static final Bitmap.Config ARGB_8888. Each pixel is stored on 4 bytes. Each channel (RGB and alpha for translucency) is stored with 8 bits of precision (256 possible values.) This configuration is very flexible and offers the best quality. It should be used whenever possible.


2 Answers

RGB888 is 24-bit, not 8-bit. Both formats you mention are 8 bits per channel, but one has three channels and one has four.

The difference is that ARGB adds an alpha channel that specifies opacity for each pixel. It's how you get semi-transparent images.

RGB is the same as ARGB with an implicit assumption that the alpha value is 255, or, in other words, fully opaque.

like image 149
chiastic-security Avatar answered Oct 11 '22 16:10

chiastic-security


A - Alpha

R - Red

G - Green

B - Blue

The difference is that ARGB adds an alpha channel that specifies opacity for each pixel. By using it you can get semi-transparent images/overlays.

RGB888 is 24-bit, not 8-bit. It has Three channels with 8 bits per channel,

ARGB8888 It has Four channels with 8 bits per channel.

Alpha value is 0-255, where 0 being fully transparent and 255 being fully opaque.

ARGB_8888 Documentation says: Each pixel is stored on 4 bytes. Each channel (RGB and alpha for translucency) is stored with 8 bits of precision (256 possible values.) This configuration is very flexible and offers the best quality. It should be used whenever possible.

like image 41
Sagar Pilkhwal Avatar answered Oct 11 '22 17:10

Sagar Pilkhwal