18.2. Understanding Image Representation

Understanding images requires understanding a set of abstractions:

  1. Images are made up of little pixels (objects of the Pixel class), laid out on an (x,y) grid.

  2. Each pixel contains a red value, a green value, and a blue value.

  3. Each color value is actually a number between 0 and 255.

  4. If a pixel has red=0, green=0, and blue=0 then the color is black since this is an absence of any color of light.

  5. If a pixel as red=255, green=255, and blue=255 then the color is white. Try tilting the bottom of a cd in white light to see the colors in the light.

A grid with horizontal (x) and vertical (y) dimensions

Figure: A grid with horizontal (x) and vertical (y) dimensions

There are some excellent CS Unplugged activities for understanding image and color representation.

You have attempted of activities on this page