18.2. Understanding Image Representation¶
Understanding images requires understanding a set of abstractions:
Images are made up of little pixels (objects of the Pixel class), laid out on an (x,y) grid.
Each pixel contains a red value, a green value, and a blue value.
Each color value is actually a number between 0 and 255.
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.
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.
There are some excellent CS Unplugged activities for understanding image and color representation.