Welcome to Representing Images!

Ever wondered how your smartphone screen shows beautiful photos or how a video game creates realistic worlds? To a computer, an image isn't a "picture"—it is just a massive collection of numbers. In this chapter, we will learn how computers turn 1s and 0s into the colorful images we see every day.

Don't worry if this seems a bit "maths-heavy" at first. We will break it down into small, simple steps, and you'll be calculating image sizes like a pro in no time!

What is a Pixel?

If you look really closely at a computer screen (or use a magnifying glass), you’ll see that the image is made up of thousands of tiny little squares. Each one of these squares is called a pixel.

Key Definition: The word pixel is short for "picture element." It is the smallest single point in a graphical image.

Think of it like this: Imagine a giant mosaic made of tiny colored tiles. From far away, you see a picture of a face. Up close, you realize it is just thousands of individual square tiles. In a digital image, those tiles are the pixels.

Did you know?

The more pixels you have in a small space, the sharper the image looks. This is why a "High Definition" (HD) screen looks much better than an old, chunky television!

Understanding Bitmaps

Most of the images we use (like JPEGs or PNGs) are bitmaps. A bitmap image is a grid where each "map" square (pixel) is represented by a bit (a 1 or a 0).

To describe a bitmap, we need to know two main things:
1. Image Size: How many pixels wide and high the image is.
2. Colour Depth: How many bits we use to represent the color of each pixel.

1. Image Size

We measure the size of an image by its dimensions. We always write this as width x height.

Example: An image that is 10 pixels wide and 10 pixels high has a size of \(10 \times 10\), which means it contains 100 pixels in total.

2. Colour Depth

Colour depth is the number of bits used to represent each pixel. The more bits you use per pixel, the more colors you can show!

1-bit colour depth: Each pixel is either a 0 or a 1. This means the image can only have 2 colors (usually black and white).
2-bit colour depth: Each pixel can be 00, 01, 10, or 11. This allows for 4 different colors.
8-bit colour depth: This allows for 256 different colors (\(2^8\)).

Memory Aid: To find out how many colors a bit depth can show, use the power of 2! If the depth is n, the number of colors is \(2^n\).

Key Takeaway:

Increasing the number of pixels (image size) or increasing the colour depth will make the image look better (higher quality), but it will also make the file size much larger because there is more data to store.

Calculating Image File Size

The AQA syllabus requires you to calculate the file size of a bitmap. Here is the secret formula:

Size (in bits) = Width \( \times \) Height \( \times \) Colour Depth

Since most people prefer to talk about bytes rather than bits, you often have to do one extra step. Remember: 8 bits = 1 byte.

Size (in bytes) = \( \frac{Width \times Height \times Colour Depth}{8} \)

Step-by-Step Example:

Question: Calculate the file size in bytes for an image that is 20 pixels wide, 10 pixels high, and has a colour depth of 8 bits.

Step 1: Find the total number of pixels.
\(20 \times 10 = 200\) pixels.

Step 2: Multiply by the colour depth to get the size in bits.
\(200 \times 8 = 1600\) bits.

Step 3: Divide by 8 to convert bits into bytes.
\(1600 / 8 = 200\) bytes.

The final answer is 200 bytes!

Common Mistake to Avoid:

Don't forget to check the units! If the exam asks for the answer in bits, stop at Step 2. If it asks for bytes, you must do Step 3.

Converting Binary to Images

Computers see images as a long string of binary. If we have a 1-bit image (black and white), the computer might see: 10100101.

If the image is \(4 \times 2\) pixels, we just wrap that string into a grid:

Row 1: 1 0 1 0
Row 2: 0 1 0 1

If 1 = Black and 0 = White, the computer would draw a checkerboard pattern! You might be asked in an exam to look at a grid and write the binary, or look at binary and shade in a grid. Just take it one pixel at a time.

Quick Review:

• Pixel: A single point in an image.
• Image Size: Width in pixels \(\times\) Height in pixels.
• Colour Depth: Number of bits per pixel.
• File Size: Increases if pixels or colour depth increase.

Summary: The Golden Rules

Rule 1: The more pixels you have, the more detail you can see, but the more storage space you need.
Rule 2: The higher the colour depth, the more realistic the colors look, but the more storage space you need.
Rule 3: Always multiply Width \(\times\) Height \(\times\) Depth to find the total bits. If you need bytes, divide that total by 8.

You’ve got this! Just remember that images are simply grids of numbers, and you'll find this section of the course much easier.