Computer science
Pixels & images
How lots of tiny dots turn into photos, emojis, and entire movies.
What you need first
Every photo on your phone, every emoji, and every video game is made of tiny dots. If you get really close to a screen, you can sometimes even see them. Here you'll find out how a computer builds a whole picture out of such dots and why some images need more storage than others.
Images are grids of dots
A digital image is a grid of rows and columns, like squared paper. Each little square in it is called a pixel, a picture dot with exactly one colour. In the simplest image there is only black and white. Then a single bit per pixel is enough: 1 means black, for example, and 0 means white. From a long row of zeros and ones the computer can rebuild the image at any time.
64 Pixel = 64 Bit = 8 Byte
Resolution: more pixels, finer image
How many pixels an image has is called its resolution. It is given as width and height, a Full HD screen for example has 1920 by 1080 pixels. An image with 8 by 8 pixels looks rough and blocky, with 1000 by 1000 pixels it looks smooth and sharp. You work out the total number of pixels like the area of a rectangle: width times height. More pixels mean a finer image, but also more storage, because every pixel has to be stored individually.
Colour needs more bits
With one bit per pixel you can only tell two colours apart. For colourful images, each pixel needs more bits. Screens mix every colour from red, green, and blue, RGB for short. If you store 8 bits for each of the three base colours, a pixel has 24 bits and can take on 16777216 shades, that is over 16 million. That's why a colour photo is much bigger than the same image in black and white.
Exercises
0 of 6 solvedTime to try it yourself. You can't break anything, every attempt counts.
What is a pixel?
A black and white image needs 1 bit per pixel. How many bits do you need for 8 pixels?
A small image is 4 pixels wide and 4 pixels tall. How many pixels does it have in total?
Screens mix every colour from red, green, and ….
Two images show the same scene and store the same number of bits per pixel. Image A has 100 pixels, image B has 10000 pixels. Which is true?
Order the images by how much storage they need, from smallest to largest.
- 1Colour image with 1000 by 1000 pixels, 24 bits per pixel
- 2Black and white image with 8 by 8 pixels, 1 bit per pixel
- 3Colour image with 8 by 8 pixels, 24 bits per pixel
Where this leads