What exactly is BGR color space?

RGB stands for Red Green Blue. Most often, an RGB color is stored in a structure or unsigned integer with Blue occupying the least significant “area” (a byte in 32-bit and 24-bit formats), Green the second least, and Red the third least.

BGR is the same, except the order of areas is reversed. Red occupies the least significant area, Green the second (still), and Blue the third.

On some platforms (e.g. the Gamegear), a BGR model is used. However, often, RGB might be used (though BGR is supported by many graphics API’s for compatibility). I’m not sure why exactly it’s used; probably historical.

Example: #FF0000 is pure red when reading as an RGB hex color (#rrggbb), because the third area (numbers are read right to left!) is FF (maximum value, full color) and the other two areas are 00 (minimum value, no color). If #FF0000 were read as a BGR hex color, it’d be pure blue.

Leave a Comment