In a digital image (in a computer) each pixel is defined as a mixture of the 3 colours. Each colour can have one of 256 different intensities, numbered from 0 to 255. 0 represents fully off, 255 represents the brightest level.
So 0,0,0 means that all 3 colours are off - black.
255,255,255 means all are fully on - white.
128,128,128 means all are about half on - mid-grey.
255,0,0, 0,255,0, and 0,0,255 mean bright red, blue and green respectively. (The 3 numbers are always given in the order red, blue, green).
A computer stores the digital image as the string of numbers representing each of the pixels making up the image.
Think of it as starting with the 3 numbers representing the top left hand pixel, followed by the 3 for the second one in the top row, then the third and so on. When you get to the end of the top row, start again with the left hand pixel of the second row.
So, an image which has 1000 x 1500 pixels will be represented in the computer by 1000x1500x3 numbers (4.5Mb).
The very simple image of 7 x 4 pixels below would be stored as the string of 84 numbers (84 bytes) shown.
![]()
(To pre-empt any questions, this is how a Bitmap image is stored - we'll come to compressed images later)
It is because the image is actually stored as numbers that we can manipulate it in the computer.
e.g. if we want to make it only half size, then we can take the pixels in groups of 4 and form a single pixel whose values are the averages of the original four.
If we want to make an image 10% lighter then we can add 10% to each of the numbers.
If we want to make it a bit redder then we can add 10% to each of the red values (and probably subtract 5% from the blue and green).