RGBA color space

RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually simply a use of the RGB color model, with extra information. The color is RGB, and may belong to any RGB color space, but an integral alpha value as invented by Catmull and Smith between 1971 and 1972 enables alpha blending and alpha compositing. The inventors named alpha after the Greek letter in the classic linear interpolation formula αA + (1-α)B.

The alpha channel is normally used as an opacity channel. If a pixel has a value of 0% in its alpha channel, it is fully transparent (and, thus, invisible), whereas a value of 100% in the alpha channel gives a fully opaque pixel (traditional digital images). Values between 0% and 100% make it possible for pixels to show through a background like a glass (translucency), an effect not possible with simple binary (transparent or opaque) transparency. It allows easy image compositing. Alpha channel values can be expressed as a percentage, integer, or real number between 0 and 1 like RGB parameters.

PNG is an image format that uses RGBA. The terms ARGB, ARGB32, or ARGB8888 are often used, for example, in Macromedia products terminology or the Silverlight framework. The term BGRA may also be seen. This represents the order that the bytes for each channel are actually in memory when ARGB32 data is stored by a little-endian CPU (such as Intel processors).

Contents

RGBA pixel formats

In computer graphics, pixels encoding the RGBA Color Space information must be stored in computer memory (or in files on disk), in well defined formats.
In most 32-bit per pixel formats (32bpp), the intensity of each channel sample is defined by 8 bits, and the samples are arranged in memory in such manner that a single 32-bit unsigned integer has the Alpha sample in the highest 8 bits, followed by the Red sample, Green sample and the Blue sample in the lowest 8 bits.
See the diagram below:

Fig.1 – An example of the most common 32bpp pixel layout

ARGB values are typically expressed using 8 hexadecimal digits, with each pair of the hexadecimal digits representing the sample values of the Alpha, Red, Green and Blue channel, respectively. For example, 0x80FFFF00 represents 50.2% opaque (non-premultiplied) yellow. The "0x" prefix is used to identify a number as hexadecimal in C notation. 0x80 represents a 50.2% alpha value, because it is 50.2% of 0xFF (in decimal 128 is 50.2% of 255), the first 0xFF represents the maximum value a red sample can have; the second 0xFF is like the previous but for green; 0x00 represents the minimum value a blue sample can have (effectively – no blue). Consequently red + green yields yellow.

See also

References

External links