Digital Technologies · Data representation: images and file size
Pixels, colour depth and image file size
Change the resolution and colour depth of a picture, watch it get sharper or blockier, and calculate the file size before compression.
- Curriculum: Digital Technologies, Data representation: images and file size
- Class: JSS 2 – SSS 1
- For BECE, WAEC, NECO practicals
- Readings, table and graph
- Quiz with answers explained
Start this experimentAll Digital Technologies experiments
Aim
To find how resolution and colour depth affect image quality and file size.
Apparatus
- Simulated image (a sunset over hills)
- Resolution and colour-depth controls
- File-size calculator
Theory
A digital image is a grid of tiny squares called pixels. The number of pixels across × down is the resolution. Each pixel is stored as a binary number; the number of bits per pixel is the colour depth.
file size (bits) = width × height × colour depth
bytes = bits÷8; 1 KB = 1024 bytes
More pixels or more bits per pixel give a better picture but a bigger file. Formats such as JPEG and PNG compress the data to make files smaller.
Procedure
- Choose the resolution (width; the height is three-quarters of the width).
- Choose the colour depth.
- Look at the picture quality and note the file size.
- Record the results.
- Repeat for different settings and plot file size against number of pixels.
Precautions
No hazards.
What you do in the virtual lab
Set up the apparatus on screen, take readings and record them in a table (Width (px); Height (px); Pixels; Bits per pixel; File size (KB)), then plot File size (KB) against Number of pixels and read the result from the graph. Simulated instruments give slightly different readings each time, as real ones do. Finish with a short quiz; every answer is explained.
Teachers can set the experiment for a class, see each student’s results and use it as a WAEC- or NECO-style practical paper in exam practice.
Practice questions
A pixel is
- a type of camera
- a unit of sound
- a computer virus
- the smallest dot (square) of colour in a digital image
Show the answer
D. the smallest dot (square) of colour in a digital image Pixel is short for “picture element”.
An image 100 × 50 pixels has
- 5000 pixels
- 150 pixels
- 50 pixels
- 500 pixels
Show the answer
A. 5000 pixels 100 × 50 = 5000.
Colour depth means
- how dark the picture is
- the size of the screen
- the number of bits used for each pixel
- the number of pictures
Show the answer
C. the number of bits used for each pixel More bits per pixel allow more colours.
Related Digital Technologies experiments
- Logic gates and truth tablesSwitch the inputs of AND, OR, NOT, NAND, NOR and XOR gates and build each truth table.
- Binary, octal and hexadecimalFlip eight bit-switches to see how computers store numbers, then hit target values in binary.
- Programming a robot: sequence and loopsWrite a program of moves and turns to steer a robot to its goal, then shorten it with a loop.
- How strong is a password?Test made-up passwords, measure their strength in bits and see how long an attacker would need to guess them.
- Spreadsheet formulas and functionsUse cell references, SUM, AVERAGE, MAX and IF to complete a shop sales record and a class result sheet.
- Coding in PythonWrite real Python – print, variables, loops and if statements – and have each program checked automatically.