Learning path

Full curriculum

Full curriculum

Unit content

Digital color channels and RGB

A color image usually stores several numerical channels per pixel. In an RGB image, the channels represent red, green and blue contributions to an additive display color.

A pixel can be written as a vector

$$\mathbf{c}=(R,G,B),$$

with each component represented over a chosen numeric range such as $[0,1]$ or by an integer code such as 0–255.

RGB is a device-oriented model: displays create colors by combining emitted red, green and blue light. Other representations are useful for other purposes. CMYK models subtractive printing inks, while hue-based coordinates such as HSV reorganize RGB-like color information for selection and editing.

A numeric triplet is not a complete physical description of color unless its color space and encoding are known. Two files containing the same three numbers can represent different displayed colors if they use different primaries or transfer functions.

Color channels are therefore structured data with an interpretation, not merely three arbitrary numbers.