AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Pixels, bits and sound

Week 24 · Unit 7.5: Living with AI · 3 lessons
1

Pixels and bits

Computing 7: Unit 7.5, pp. 150–181
GoalExplain how a picture becomes pixels and bits, and work out how many bits a black-and-white picture needs.
New words
bit · a binary digit, which is 0 or 1pixel · a tiny square of a picture; short for ‘picture element’bitmap · a picture stored as a grid of pixels, each with its own bitscolour depth · the number of bits used for each pixel
Explanation

All data in a computer is stored in binary. Binary uses only two digits, 0 and 1, and each one is a bit. An old film photo is analogue, so it must be turned into digital data first. A scanner or a camera divides the picture into a grid of tiny squares called pixels. Each pixel is stored with bits. A picture with only black and white needs one bit for each pixel: 1 for black and 0 for white. We say its colour depth is 1. To find the size of a bitmap, multiply the pixels across by the pixels down, then multiply by the colour depth. A picture with more pixels has a higher resolution, so it looks sharper but needs more bits.

00010000011100011111000111000111110111111100010000001000
Worked examples
Pixels acrossPixels downColour depthBits needed
78156
This tree is 7 pixels wide and 8 pixels high. It uses black (1) and white (0), so the colour depth is 1. The file size is 7 × 8 × 1 = 56 bits.
PictureAcross × downCalculationBits
small8 × 88 × 8 × 164
medium16 × 1616 × 16 × 1256
large32 × 3232 × 32 × 11024
Resolution changes the size. A larger grid has more pixels and needs more bits. The table shows three black-and-white pictures.
An analogue photo becomes digital in a few steps. First it is input with a scanner or camera. Then it is divided into pixels. Each pixel is given bits, and the bits are saved as a file.
Class activity

Pixel paper (no computer): on squared paper draw a grid 6 squares across and 6 down. Colour some squares black to make a letter or a simple shape. Write 1 under every black square and 0 under every white square, row by row. Work out the number of bits: across × down × 1. Give only your numbers to a partner, who has to draw your picture from the 1s and 0s. Check whether the picture is the same. If you have a computer or tablet, an adult can help you zoom right in on a photo until the pixels appear.

Practice
1
What letter do these codes make? Black is 1.
RowCode
110001
210001
311111
410001
510001
2
A black-and-white picture is 12 pixels across and 9 pixels down. How many bits does it need?
3
The code of row 6 of the boat is hidden. Read the squares of that row (black is 1) and write the code.
0001000000110000011100001111100000010000????????0111111000111100
4
Picture A is 10 × 10 pixels and picture B is 20 × 20 pixels, both with colour depth 1. How many bits does each use? How many times bigger is B?