Colour Representation

Work in progress. This note is still being written and incomplete.

2 min read Last updated Sun Jul 26 2026 05:09:41 GMT+0000 (Coordinated Universal Time)

A digital colour image is stored as a multi-channel structure, one image per attribute.

Channels

  • RGB
    Maintains the intensity of red, green and blue in separate channels.
  • Luminance and chrominance
    Separates brightness (luminance) from colour (chrominance) into separate channels.
Y=f(R,G,B)Cr=f(RY)Cb=f(BY)Y = f(R,G,B) \qquad C_r = f(R-Y) \qquad C_b = f(B-Y)
  • Discarding Cr,CbC_r, C_b gives a monochrome image directly
  • The human visual system is more sensitive to luminance than colour, so YCrCb formats often allocate bits in a 4:2:2 ratio
  • Widely used for its inherent compression capability

Emission and absorption colours

  • Emission based
    Determined by what light should be emitted to produce a colour. Absence of light is black, presence of all components is white.
  • Absorption based
    Determined by what ink should be applied so that light reflected from the substrate produces a colour. Ink subtracts colours from white.

RGB is emission based. CMYK is absorption based.

K=min(1R,  1G,  1B)K = \min(1-R,\; 1-G,\; 1-B) C=1RK1KM=1GK1KY=1BK1KC = \frac{1-R-K}{1-K} \qquad M = \frac{1-G-K}{1-K} \qquad Y = \frac{1-B-K}{1-K}

True colour images

RGB uses 24 bits per pixel, or 3 bytes. CMYK needs 4 bytes per pixel.

Palette based representation

Storing a table of the colours actually used, then storing pointers into that table, is more storage-efficient than native RGB.

  • Palette length determines how many distinct colours can be used at once, out of the full 2242^{24}
  • Bits per pixel in image memory depend on the palette table length
  • The palette table is usually stored with the image, allowing a custom colour set per image
Was this helpful?