Data Representation CS Thinking Example 2

Follow the full solution, then compare it with the other examples linked below.

Example 2

medium
Explain how a computer represents a colour image using binary. What are pixels and colour depth?

Solution

  1. 1
    Step 1: An image is a grid of tiny dots called pixels. Each pixel has a colour value.
  2. 2
    Step 2: Colour depth is the number of bits used per pixel. With 24-bit colour (8 bits each for red, green, blue), each channel has 256 levels.
  3. 3
    Step 3: The image data is a sequence of binary values: resolution (width × height) determines the number of pixels, and colour depth determines the bits per pixel.

Answer

Images are grids of pixels, each stored as binary colour values. Colour depth (bits per pixel) determines the range of colours available.
All digital media — images, audio, video — must be converted to binary for computer storage. Understanding resolution and colour depth helps predict file sizes and quality.

About Data Representation

The way information—numbers, text, images, and sound—is encoded as binary digits (0s and 1s) inside a computer. Different encoding schemes map real-world data to binary patterns, such as ASCII/Unicode for text, RGB for colors, and sampling for audio.

Learn more about Data Representation →

More Data Representation Examples