RGB Images

Images are 2D grids of pixel values. A pixel is a value that maps to a single display element on the output device (typically a monitor). Pixels values are color intensities. In this course, we will often assign values as a triplet of color components. This is similar to how our eyes function, with three different types of receptors attuned for different wavelenghts of light, so three color components can represent much of the color spectrum we can perceive.

RGB triplets are an easy way to represent colors using three values: a red intensity, a green intensity, and a blue intensity. RGB triplets are often stored as a triplet of bytes, so the red, green, and blue values can each range from [0, 255]. A value of 0 for the component means no intensity; all three components set to 0 will produce black. What do you think happens if all three components are set to 255?


RGB values don't have to be stored as bytes. If each component is represented with a float type, the RGB values can have a very large range. In this course, you will use both byte and float types to store RGB values. Often float RGB values are clamped to the range [0.0, 1.0].