1

mrahmedcomputing

KS3, GCSE, A-Level Computing Resources

Lesson 6. Image Representation


Lesson Objective

  1. Explain how images are made up of pixels and how each pixel is represented in binary.
  2. Calculate the file size of an image.

Lesson Notes

Bitmap Images

A bitmap image, also known as a raster graphic, is a digital image composed of a grid of pixels. Each pixel in this grid represents a specific color, and together they form the image. When viewed at 100%, each dot corresponds to an individual pixel on a display. In a standard bitmap image, each dot can be assigned a different color, allowing it to represent any type of rectangular picture. However, if you zoom into a bitmap image, regardless of the file format, it will look blocky because each dot will take up more than one pixel. Therefore, bitmap images appear blurry when enlarged. Unlike vector graphics, which are composed of paths instead of dots, bitmap images cannot be scaled without reducing their quality.

Pixel - Small dot of colour on an image

Resolution - Amount of pixels on an image. Low-resolution images have larger pixels and appear blocky or pixelated. High-resolution images have more pixels and look better when enlarged.

Colour/Bit Depth - Amount of bits in each pixel (amounts of colours available)

Here is a 1 bit image of a kind of sad face...

1 1 1 1 1 1 1 1 1 1
1 0 0 1 1 1 1 0 0 1
1 0 0 1 1 1 1 0 0 1
1 1 1 1 1 1 1 1 1 1
1 1 1 0 0 0 0 1 1 1
1 0 0 0 1 1 1 0 0 1
1 0 1 1 1 1 1 0 0 1
1 0 1 1 1 1 1 0 0 1
1 0 1 1 1 1 1 0 0 1
1 1 1 1 1 1 1 1 1 1

Colours and Bit Depth

Color depth determines the number of unique colors an image can display.

Each pixel in an image is assigned a specific color, and the number of bits allocated to each pixel defines the available color range. For example:

  • 1-bit color depth: Only two colors (usually black and white).
  • 8-bit color depth: Up to 256 possible colors.
  • 24-bit color depth: Over 16 million colors (commonly used in photographs).

Digital images consist of a grid of tiny squares called pixels. Each pixel corresponds to a specific color value. The combination of pixels creates the overall image.

Higher bit depth allows for more colors per pixel. Adding more bits exponentially increases the color possibilities:

  • 1 bit per pixel: 2 colors (black and white).
  • 2 bits per pixel: 4 colors.
  • 3 bits per pixel: 8 colors.
  • 4 bits per pixel: 16 colors.
  • and so on...

Image size is dependent on the resolution and the colour depth of an image. You can calculate image file size using the following formula: File Size (Bits) = Resolution x Bits per Pixel

Metadata includes information about the file itself (e.g., creation date) and the image data (e.g., dimensions).

3