DataLens

See the data. Change the representation. Discover the trade-off.

GCSE foundations

Inspect a pixel or choose Paint. Compare your original with its stored palette representation.

Pixel studio

8 × 8 · 4 bpp
Original RGB colours · reference
Stored palette codes · click to inspect
Selected: x=0, y=0 · code 0000 · #000000Changing depth preserves the RGB original. Painting edits it. Arrows move the selection; Enter applies the selected tool.
32 B raw payloadMore pixels → more spatial detail · more bits → more palette colours0/18 challenges · device practice

DataLens learning guide

Predict → Run → Investigate → Modify → Make. Explore freely, then try eighteen independent checked challenges. Every challenge starts with a prediction and unlocks a practical task. Hints, checks and completion are recorded on this device; they do not award course XP or appear in teacher dashboards.

Images

Paint or inspect an 8, 12 or 16 pixel square. Row-major binary codes select colours from a predefined palette. Colour depth changes palette capacity; canvas dimensions change pixel count. Resizing uses nearest-neighbour sampling. The original RGB data is retained, so changing depth back restores the original comparison. Raw size is width × height × depth bits, excluding headers, palette tables and compression.

Sound

The graph shows 4 ms of a synthetic signal. Sample rate is measured in samples per second per channel; bit depth selects amplitude precision. Duration and channels multiply file size. The 0.7-second audio preview is independent of the chosen recording duration and plays a mono example; stereo size is modelled as two channels. No microphone or personal audio is used. The reference preview is generated at 48 kHz. Square and triangle waves contain harmonics and can alias without filtering.

Advanced shows uniform endpoint quantisation, numerical codes, window mean squared error and a sine alias example. At or above half the sampling rate, a sine cannot in general be recovered uniquely; practical systems use anti-alias filtering and headroom. This model is not a full analogue-to-digital converter or a particular PCM file format.

Compression

RLE stores pairs of 8-bit count and 8-bit character, splitting runs at 255. Dictionary mode is a fixed 9-bit LZW variant with initial codes 0–255, new entries 256–511 and a frozen full dictionary. Its decoder rebuilds phrases from codes. Both are lossless; byte padding is included and headers/container overhead are excluded. Short data can grow. Basic teaches why repetition and lossless recovery matter; Advanced adds dictionary tracing. Each step emits one token; phrase matching can read several source characters between events. These are teaching examples, not claims that specific codecs are GCSE requirements.

Saving and accessibility

Use Files to save or download experiment settings. Projects and practice are device-local, so shared computers share records. Returning to Explore restores your earlier experiment; Modify in Explore keeps the challenge settings. Keyboard users can focus the selected pixel, move with arrows and use Enter/Space to inspect or paint. All calculated totals use bytes; 1 kB = 1,000 B and 1 KiB = 1,024 B. Focus Mode hides the main header; Escape exits it. Small screens stack panels.

Teacher notes and worked challenge answers

01 · More colours: One bit has two patterns: 0 and 1. Count every 2-bit pattern: 00, 01, 10, 11. Checked answer: 4.

02 · Four times the pixels: 2 × width × 2 × height = 4 × the original pixel count. 16 × 16 × 1 gives bits. Divide by 8 for bytes. Checked answer: 32.

03 · Paint the byte: Each fixed-width code selects one palette colour. Choose black and paint columns 0, 2, 4 and 6. White fills columns 1, 3, 5 and 7.

04 · Find a pixel: This model stores complete rows from left to right, top to bottom. The checkerboard uses 0 for black and 1 for white. x+y is odd here. Checked answer: 1.

05 · Store a palette: 2⁴ gives sixteen distinct codes. 64 pixels × 4 bits ÷ 8. Checked answer: 32.

06 · Pixel budget: Width × height × depth counts pixel payload. A real format may add metadata and a palette. At 2 bits per pixel, 256 pixels take 512 bits.

07 · Samples every second: Sample rate is the number of samples taken per second, not the pitch of the sound. 16,000 × 8 × 1 × 1 ÷ 8. Checked answer: 16000.

08 · Finer amplitude steps: Bit depth controls the number of amplitude codes. Sample rate controls time spacing. Use 2 to the power of the sample bit depth. Checked answer: 256.

09 · Two channels: Each channel needs its own sample stream. Multiply by 2 channels before converting bits to bytes. Checked answer: 16000.

10 · Five-second message: Duration is part of the size calculation independently of pitch. 16,000 × 16 × 5 ÷ 8. Checked answer: 160000.

11 · A misleading waveform: The sine exceeds half the sampling rate. It aliases to a lower frequency; practical systems need filtering and margin. The new Nyquist frequency is 16,000 ÷ 2. Checked answer: 8000.

12 · Audio budget: For fixed-rate uncompressed samples, rate, depth, duration and channels determine size. Use the lowest permitted rate and 8-bit samples. Avoid a second channel.

13 · Count the runs: Separate runs of the same symbol stay separate. There are two runs. Each needs two bytes. Checked answer: 4.

14 · Bigger after compression?: Encoding overhead can exceed the savings. Lossless does not mean smaller for every input. Eight one-character runs each need a count and a character. Checked answer: 16.

15 · Make it compress: Counts and symbols reconstruct the exact original: RLE is lossless. Try three runs of three identical symbols, such as AAABBBCCC.

16 · Reuse a phrase: Dictionary codes can refer to phrases such as AB, even when A and B alternate. Initial byte codes use 0–255. The first new phrase AB gets code 256. Checked answer: 256.

17 · Count the code bits: Nine bits can represent codes 0–511. This teaching variant freezes its dictionary at 512 entries. Count the emitted codes, then multiply by 9. Checked answer: 144.

18 · Choose the better model: The pattern and encoding overhead decide which model works better. Try a long alternating phrase, such as AB repeated at least twelve times.

Curriculum references

OCR GCSE J277 §1.2.3–1.2.5 · OCR A-level compression delivery guide. The lab supports these topics and provides extensions; it does not cover the whole specification.

Back to Primm Tools