Memory & StorageKey Facts

Run-Length Encoding (RLE) - Simple Lossless

Part of CompressionGCSE Computer Science

This key facts covers Run-Length Encoding (RLE) - Simple Lossless within Compression for GCSE Computer Science. Revise Compression in Memory & Storage for GCSE Computer Science with 15 exam-style questions and 16 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 4 of 11 in this topic. Use this key facts to connect the idea to the wider topic before moving on to questions and flashcards.

Topic position

Section 4 of 11

Practice

15 questions

Recall

16 flashcards

Run-Length Encoding (RLE) - Simple Lossless

How RLE Works:

Replace repeated values with a count + value. Instead of "AAAAAABBCC", store "6A2B2C".

Example 1: Simple Pattern

  Original: WWWWWWBBBWWW (12 characters)
  RLE:      6W3B3W (6 characters)
  
  Saved: 50% compression ratio
  

Example 2: Binary Data

  Original: 00000000111111110000000 (23 bits)
  RLE:      8×0, 8×1, 7×0 (3 pairs)
  
  Stored as: 8,0,8,1,7,0
  

Example 3: Image Data (Scanline)

  Image row (colors): RRRRRRGGGGBBBBBB (16 pixels)
  RLE:                6R4G6B (3 pairs)
  
  Original: 16 pixels × 3 bytes = 48 bytes
  RLE:      3 pairs × (count + color) = 6 bytes
  Saved:    87.5%!
  

When RLE Works Well:

  • Large blocks of same color: Simple graphics, logos, cartoons
  • Black and white images: Scanned documents, faxes
  • Video frames: Large unchanged areas between frames

When RLE Fails:

  • No repetition: ABCDEFGH → 1A1B1C1D1E1F1G1H (BIGGER!)
  • Random data: Photos, complex images - little to no repetition
  • Can make file larger if there's no pattern

Keep building this topic

Read this section alongside the surrounding pages in Compression. That gives you the full topic sequence instead of a single isolated revision point.

Practice Questions for Compression

Which statement correctly describes lossy compression?

  • A. The original file can be perfectly restored after decompression.
  • B. Data is permanently removed and the original cannot be exactly recreated.
  • C. The compressed file is always the same size as the original.
  • D. No data is removed during the compression process.
1 markfoundation

Explain how run-length encoding (RLE) works to compress data.

3 marksstandard

Quick Recall Flashcards

Want to test your knowledge?

PrepWise has 15 exam-style questions and 16 flashcards for Compression — with adaptive difficulty and instant feedback.

Join Alpha