Human Fax Machine
How does an image become numbers — and back again?
Year 9 Computer Science — Binary Encoding & Compression
Everything Is Numbers
How does a photo travel across the internet?
How did fax machines work in the 1980s?
The image must become binary numbers first.
Rule: ■ = 1 (filled pixel) | □ = 0 (empty pixel)
8×8 Encoding
Read row by row, left to right:
■□■■□□■□ → 1 0 1 1 0 0 1 0
8 pixels per row × 8 rows = 64 bits per image.
That's the raw, uncompressed binary representation.
Human Fax Machine
Transmitter — has the filled image. Reads bits aloud row by row.
Receiver — has the blank grid. Fills in squares based on what they hear.
- 1 = fill the square
- 0 = leave it blank
- Any errors? Note which row!
Run-Length Encoding (RLE)
Instead of listing every bit, describe runs of identical values:
0 0 0 1 1 1 1 0 0
→ (3,0)(4,1)(2,0)
3 zeros, 4 ones, 2 zeros
Original: 9 values → RLE: 6 numbers
Compression ratio: 9/6 = 1.5:1
Apply RLE to Images
Use the worksheet to apply RLE to:
- Checkerboard — alternates every pixel
- Solid Block — large areas of the same colour
Calculate the compression ratio for each. Which is better? Why?
Results Discussion
Checkerboard: terrible compression — every run length is 1. RLE makes it LARGER.
Solid Block: excellent compression — long runs of 0s and 1s. Much smaller.
Key insight: RLE works when data has long runs of the same value.
Real World
- Fax machines — use RLE; blank pages transmit much faster than dense text
- BMP files — can use RLE compression
- JPEG/PNG/GIF — use more sophisticated compression algorithms
- Lossless vs lossy — RLE is lossless (perfect reconstruction). JPEG is lossy (some data discarded).
Key Takeaway
All digital images are binary numbers.
Compression removes redundancy — repeated patterns compress well, varied patterns don't.
RLE is one of the simplest and most elegant compression algorithms.
1 / 9
← → or click to advance