📑 Contents
1. Introduction to Multimedia 2. Bitmap Images 3. Colour & Bit Depth 4. Image & Screen Resolution 5. Bitmap File Size Calculations 6. Vector Graphics 7. Bitmap vs Vector Comparison 8. Sound Representation 9. Sampling Rate & Resolution 10. Key Takeaways 11. Exam-Style Questions 12. Exam Success Tips

Chapter 1.2 - Multimedia

Cambridge 9618 AS Computer Science

📚 Learning Objectives

1.1 Introduction to Graphics

Images are an important type of data that computers handle. To process and display images, computers must represent them in a digital form using binary numbers.

Images can be stored in a computer in two common formats:

★ Two Types of Graphics ★ Bitmap Image Made of tiny pixels .jpg .png .bmp .gif vs Vector Graphic circle rect polygon Mathematical formulas .svg .ai .eps 🤖 Both store images digitally, but use different methods!
🌟 Did You Know?

The word "pixel" is a combination of "picture" and "element". It was first used in 1965 by Frederic C. Billingsley at NASA's Jet Propulsion Laboratory!

Remember!

1.2 Bitmap Images

📖 Definition: Bitmap Image

A bitmap image is made up of pixels (picture elements). The image is stored in a two-dimensional matrix of pixels. Each pixel can be a small rectangle, a small circle, or a dot.

📖 Definition: Pixel

A pixel is the smallest identifiable component of a bitmap image, defined by just two properties:

Bitmaps are also known as pixelmaps or raster graphics.

How Bitmap Images Work

★ Bitmap Image Structure ★ 🔍 1 pixel = 1 colour Width = 5 pixels Height = 4 pixels Binary Storage Each pixel stores a binary colour code 10110011 ↑ 8 bits = 1 byte 11110000 Position Colour Binary Storage 📸 Common Uses: Digital cameras, smartphones, photographs
💡 Exam Tip

When asked about bitmap images in exams, always mention that they are made up of pixels and each pixel has a defined position and colour. This is the key distinction from vector graphics!

!

1.3 Colour Depth & Bit Depth

📖 Definition: Colour Depth

Colour depth is the number of bits used to represent the colour of each pixel. It determines how many different colours can be displayed.

📖 Definition: Bit Depth

Bit depth is the number of bits used to store each of the red, green, and blue primary colours in an RGB colour model.

The simplest scheme uses 1 bit per pixel (black or white). More bits allow more colours:

Colour/Bit Depth Number of Colours Example Use
1 bit 21 = 2 Black & White
4 bits 24 = 16 Simple graphics
8 bits 28 = 256 GIFs, retro games
16 bits 216 = 65,536 High colour
24 bits (True Colour) 224 = 16,777,216 High-quality images
32 bits 232 = 4,294,967,296 Professional graphics
RGB Colour Model (24-bit True Colour) RED 8 bits (0-255) 2⁸ = 256 values GREEN 8 bits (0-255) 2⁸ = 256 values BLUE 8 bits (0-255) 2⁸ = 256 values 24 bits = 256 × 256 × 256 = 16,777,216 possible colours!
Formula: Number of Colours = 2n where n = colour depth (bits per pixel)
⚠️ Common Mistake

Don't confuse colour depth with bit depth!

So 8-bit depth × 3 channels = 24-bit colour depth

🌟 Did You Know?

If a lower bit depth is used, images will show bands of colour instead of smooth gradients. This is called "banding" or "posterization".

?

1.4 Image Resolution & Screen Resolution

📖 Definition: Image Resolution

Image resolution is the number of pixels in a bitmap file, defined as the product of width and height values.

Example: An image with 1920 × 1080 pixels has 2,073,600 total pixels.

📖 Definition: Screen Resolution

Screen resolution is the product of width and height values for the number of pixels that a screen can display.

Example: A 4K display has 3840 × 2160 pixels.

📖 Definition: Pixel Density

Pixel density is the number of pixels per square inch (PPI - Pixels Per Inch). Higher PPI means sharper display.

Image vs Screen Resolution Image Resolution 4096 × 3192 pixels Original Image Screen Resolution 1920 × 1080 pixels Screen Display If screen resolution < image resolution, image must be resized or cropped!

Calculating Pixel Density (PPI)

Example: Calculate pixel density for an iPhone 8 with 5.5-inch screen and resolution 1920 × 1080:

  1. Add squares of resolution: (1920)² + (1080)² = 3,686,400 + 1,166,400 = 4,852,800
  2. Find square root: √4,852,800 = 2202.907
  3. Divide by screen size: 2202.907 ÷ 5.5 = 401 PPI
💡 Exam Tip

When image resolution is higher than screen resolution, the image must be either:

⚠️ Important

Why does bitmap image quality become poor during zooming?

When zooming in on a bitmap, the number of pixels stays the same but each pixel is stretched to cover a larger area. This causes the image to look blocky and pixelated.

1.5 Calculating Bitmap File Size

File Size (bits) = Resolution × Colour Depth

File Size (bits) = Width × Height × Bits per Pixel

File Size Calculation Process Step 1 Calculate total bits W × H × Depth Step 2 Convert to bytes ÷ 8 Step 3 Convert to KiB/MiB ÷ 1024 Unit Conversions: • bits → bytes: ÷ 8 • bytes → KiB: ÷ 1024 • KiB → MiB: ÷ 1024 • MiB → GiB: ÷ 1024 1 KiB = 1024 bytes 1 MiB = 1024 KiB

Worked Example 1

Question: A bitmap graphic fills a laptop screen with resolution 1366 × 768 pixels. Colour depth is 24 bits. Calculate the file size in MiB.

Solution:

Worked Example 2

Question: Calculate the file size of a bitmap to be printed at 72 dpi, dimensions 5" × 3", with bit depth of 8.

Solution:

📖 Definition: Bitmap File Header

A file header is a set of bytes at the beginning of a bitmap file which identifies the file type and contains metadata about the image.

File header contains:

⚠️ Common Mistake

Remember: The bitmap file size is larger than the size of just the graphic data because it also includes the file header!

1.6 Vector Graphics

📖 Definition: Vector Graphic

A vector graphic is an image made up of mathematical shapes such as straight lines and curves, using coordinates and geometry to precisely define the parts of the image.

Vector graphics can be designed using:

Key Components of Vector Graphics

Vector Graphic Structure Drawing List (in File Header) Line Object Start point (x₁, y₁) End point (x₂, y₂) Circle Object Centre (x, y) Radius Rectangle Object Start point (x, y) Width, Height Properties stored: • Command for each object • Attributes (position, size, colour) • Relative position to other objects Key advantage: Dimensions NOT fixed! Only relative positions stored → Infinite scalability without quality loss
🧠 Memory Trick

"V-P-S-C" for Vector Graphics advantages:

Example Drawing List Entry:

Line: Start(10,20), End(50,20), Colour(Black), Thickness(2)
Circle: Centre(100,100), Radius(30), Fill(Red), Border(Black)
Rectangle: Start(200,50), Width(50), Height(30), Border(Blue)
💡 Exam Tip

When a vector graphic is displayed, the file is read and calculations are made to draw the objects. If the user resizes the image, the file is read again and new calculations are made - this is why quality is preserved!

VS

1.7 Bitmap vs Vector Graphics

Feature Bitmap Images Vector Graphics
Composition Made of tiny pixels Made of mathematical shapes
Scalability Loses quality when resized (pixelates) Can be resized infinitely without quality loss
File Size Large (depends on resolution) Smaller (uses formulas, not pixels)
Best For Photographs, complex textures Logos, icons, diagrams
Editing Edit individual pixels Edit shapes and properties
Realism Very realistic Less realistic (cartoon-like)
File Formats .jpg, .png, .bmp, .gif .svg, .ai, .eps, .cgm, .odg

When to Use Bitmap Images

When to Use Vector Graphics

Scaling Comparison Original Bitmap Zoomed In Pixelated! (blocks visible) Original Vector Zoomed In Still Sharp! (recalculated) Decision Questions: Does it need to be resized? → Vector Does it need to look real? → Bitmap Does it need to be drawn to scale? → Vector Are there file size restrictions? → Consider both
🌟 Did You Know?

Vector graphic files can only be displayed directly on a graph plotter. For most displays, they must be converted to bitmap first. This is called rasterisation.

2.1 Sound Representation

📖 Key Concepts

Sound cannot travel in a vacuum - it requires a medium. It is transmitted by causing oscillations of particles within the medium.

The human ear picks up these oscillations (changes in air pressure) and interprets them as sound.

📖 Definition: Analogue vs Digital

Analogue data is data obtained by measurement of a physical property which can have any value from a continuous range of values.

Digital data is data that has been stored as a binary value which can have one of a discrete range of values.

How Sound is Encoded

★ Sound Encoding Process ★ Analogue Sound Wave Amplitude ● = Sample points Sound Encoder 1. Band-limiting filter 2. ADC Converter Digital 1011 0110 1101 0011 ★ What is Sampling? ★ Taking measurements at regular intervals ↑ Vertical lines = sampling intervals 🔊 Amplitude = Loudness of sound 🎵 Frequency = Pitch of sound 🤖 More samples = Better sound quality but larger file size!
📖 Definition: Sampling

Sampling is the process of taking measurements at regular intervals and storing the value. Each sample records the amplitude of the sound wave at that point in time.

💡 Exam Tip

Remember the two components of a sound encoder:

  1. Band-limiting filter - removes very high frequencies that human ear cannot detect (would cause coding problems)
  2. ADC (Analogue-to-Digital Converter) - converts analogue data to digital binary values
!

2.2 Sampling Rate & Sampling Resolution

📖 Definition: Sampling Rate

Sampling rate is the number of samples taken per second, measured in Hertz (Hz).

Example: 44.1 kHz (CD quality) = 44,100 samples per second

📖 Definition: Sampling Resolution

Sampling resolution (also called bit depth) is the number of bits used to store each sample's amplitude.

Example: 16-bit resolution allows 216 = 65,536 possible amplitude values

Effect of Sampling Rate & Resolution Low Sampling Rate Fewer samples = less detail High Sampling Rate More samples = more detail Low Resolution (8-bit) 256 possible values Steps between values large More quantisation error High Resolution (16-bit) 65,536 possible values Steps between values small Less quantisation error Nyquist's Theorem Sampling rate must be at least twice the highest frequency in the sound Human hearing: up to 20,000 Hz CD sampling rate: 44,100 Hz (> 2 × 20,000)

Sound File Size (bits) = Sampling Rate × Sampling Resolution × Duration × Channels

Channels: Mono = 1, Stereo = 2

Worked Example

Question: Audio is sampled at 44.1 kHz using 8 bits. Two channels (stereo) are used. Calculate the size of a 30-second recording in MiB.

Solution:

Factor Effect on Quality Effect on File Size
Higher Sampling Rate More detail, better sound quality Larger file size
Higher Resolution More precise amplitude, less distortion Larger file size
⚠️ Common Mistake

Don't forget to account for stereo recordings (2 channels) when calculating file size! Many students forget to multiply by 2.

📝

Key Takeaways

📝 Bitmap Images - Complete Summary

📝 Vector Graphics - Complete Summary

📝 Sound Representation - Complete Summary

🧠 Quick Memory Aid - File Size Formulas

🖼️ Image: W × H × Colour Depth → bits → ÷8 (bytes) → ÷1024 (KiB) → ÷1024 (MiB)

🔊 Sound: Rate × Resolution × Duration × Channels → bits → ÷8 (bytes) → ÷1024 (KiB) → ÷1024 (MiB)

Remember: 1 KiB = 1024 bytes, 1 MiB = 1024 KiB, 1 GiB = 1024 MiB

Or for decimal: 1 KB = 1000 bytes, 1 MB = 1,000,000 bytes

Q

Exam-Style Questions

Q1. A photograph has a bit depth of 8 and image resolution of 1500 pixels wide and 3000 pixels high. Calculate the file size of the photograph in megabytes (MB). [3 marks]

Mark Scheme:

  • Bit depth of 8 means 8 bits for each RGB channel → 24 bits per pixel (colour depth) ✓
  • Total pixels = 1500 × 3000 = 4,500,000 pixels ✓
  • File size = 4,500,000 × 24 = 108,000,000 bits ✓
  • Convert to bytes: 108,000,000 ÷ 8 = 13,500,000 bytes
  • Convert to MB: 13,500,000 ÷ 1,000,000 = 13.5 MB

Additional points: If using MiB (1024-based), answer would be ~12.9 MiB. Always check if question asks for MB or MiB.

Q2. Describe how sound is represented in a computer. [4 marks]

Mark Scheme:

  • Sound is analogue and must be converted to digital ✓
  • Amplitude is recorded/sampled at set intervals ✓
  • Each amplitude value is converted to a binary number ✓
  • Binary values are stored in sequence ✓
  • Higher sampling rate = more samples per second = better quality
  • Higher resolution = more bits per sample = more accurate amplitude
  • Analogue-to-Digital Converter (ADC) used for conversion

Q3. A camera detector has an array of 1920 by 1536 pixels. Colour depth of 16 bits is used. Calculate the size of the photograph, giving your answer in MiB. [3 marks]

Mark Scheme:

  • Total pixels = 1920 × 1536 = 2,949,120 pixels ✓
  • Total bits = 2,949,120 × 16 = 47,185,920 bits ✓
  • Bytes = 47,185,920 ÷ 8 = 5,898,240 bytes
  • MiB = 5,898,240 ÷ (1024 × 1024) = 5.625 MiB

Q4. Photographs have been taken by a smartphone which uses a detector with a 1024 × 1536 pixel array. Software uses a colour depth of 24 bits. How many photographs could be stored on a 16 GiB memory card? [4 marks]

Mark Scheme:

  • Total pixels = 1024 × 1536 = 1,572,864 pixels ✓
  • File size per photo = 1,572,864 × 24 = 37,748,736 bits ✓
  • Convert to bytes: 37,748,736 ÷ 8 = 4,718,592 bytes ✓
  • 16 GiB = 16 × 1024 × 1024 × 1024 = 17,179,869,184 bytes
  • Number of photos = 17,179,869,184 ÷ 4,718,592 ≈ 3,640 photos

Note: Real-world answer would be less due to file headers, metadata, and file system overhead.

Q5. Explain the difference between a bitmap image and a vector graphic. Give one example of when each would be the best choice. [5 marks]

Mark Scheme:

  • Bitmap: Made up of pixels arranged in a grid/matrix ✓
  • Each pixel has defined position and colour ✓
  • Loses quality when scaled up (pixelates) ✓
  • Vector: Made up of mathematical shapes/formulas ✓
  • Stores drawing list with commands and properties ✓
  • Can be scaled infinitely without quality loss ✓
  • Bitmap best for: Photographs, complex textures, realistic images ✓
  • Vector best for: Logos, icons, diagrams, technical drawings ✓

Q6. A company needs to create a logo that will be used on both business cards and billboards. Justify whether they should use a bitmap or vector graphic. [4 marks]

Mark Scheme:

  • Should use a vector graphic
  • Logo needs to be displayed at very different sizes (small card, large billboard) ✓
  • Vector graphics can be scaled infinitely without quality loss ✓
  • Bitmap would pixelate/become blurry when enlarged for billboard ✓
  • Vector files are typically smaller for simple logo designs ✓
  • Vector allows easy editing of colours and shapes ✓
Q

Exam-Style Questions (continued)

Q7. Audio is being sampled at the rate of 44.1 kHz using 16 bits. Two channels (stereo) are being used. Calculate the size of a 30-second audio recording in MiB. [4 marks]

Mark Scheme:

  • File size = Sampling Rate × Resolution × Duration × Channels ✓
  • = 44,100 × 16 × 30 × 2 = 42,336,000 bits ✓
  • Bytes = 42,336,000 ÷ 8 = 5,292,000 bytes ✓
  • MiB = 5,292,000 ÷ (1024 × 1024) ≈ 5.05 MiB

Common mistake: Forgetting to multiply by 2 for stereo channels!

Q8. Explain why a bitmap file size is larger than the size of the graphic data alone. [2 marks]

Mark Scheme:

  • Bitmap file contains file header in addition to pixel data ✓
  • Header contains metadata: file type, size, resolution, colour depth, compression type ✓
  • This additional data increases total file size beyond just the graphic data

Q9. What is meant by the term "sampling resolution" when referring to sound files? Explain how increasing the sampling resolution affects the quality and file size of a sound recording. [4 marks]

Mark Scheme:

  • Definition: Sampling resolution is the number of bits used to store each sample/amplitude value ✓
  • Effect on quality: Higher resolution = more possible amplitude values = more accurate representation = less distortion/quantisation error ✓
  • Effect on file size: Higher resolution = more bits per sample = larger file size ✓
  • Example: 8-bit = 256 values, 16-bit = 65,536 values ✓

Q10. State Nyquist's theorem and explain why it is important when recording sound. [3 marks]

Mark Scheme:

  • Nyquist's theorem: Sampling rate must be at least twice the highest frequency in the sound being sampled ✓
  • Importance: Ensures all frequencies in the sound are captured accurately ✓
  • If sampling rate is too low, high frequencies are lost or cause aliasing (distortion) ✓
  • Human hearing range: ~20 Hz to 20,000 Hz → CD uses 44,100 Hz (more than 2× 20,000)

Q11. An image has resolution 100 × 200 pixels and colour depth of 8 bits. Calculate its file size in bytes. [2 marks]

Mark Scheme:

  • Total pixels = 100 × 200 = 20,000 pixels ✓
  • File size = 20,000 × 8 bits = 160,000 bits = 20,000 bytes

Q12. Describe two advantages and two disadvantages of using bitmap images compared to vector graphics. [4 marks]

Mark Scheme:

Advantages of Bitmap:

  • Can represent realistic images (photographs) with fine detail ✓
  • Supports wide range of colours and gradients ✓
  • Compatible with most devices and software ✓

Disadvantages of Bitmap:

  • Loses quality when scaled up (pixelates) ✓
  • Larger file sizes for high resolution images ✓
  • Cannot easily edit individual components ✓

💡 Exam Success Tips

💡 Tip 1: Unit Conversions

Always check which units the question asks for:

Using the wrong conversion will lose marks!

💡 Tip 2: Show Your Working

Always show each step of calculations:

Even if you make an arithmetic error, method marks may be awarded!

💡 Tip 3: Remember Stereo!

For sound calculations involving stereo recordings, always multiply by 2 channels. This is one of the most common mistakes!

💡 Tip 4: Keywords Matter

Use correct terminology in your answers:

🧠 Final Memory Check

File Size Formulas:

🖼️ Image: W × H × Depth → bits → bytes → larger units

🔊 Sound: Rate × Resolution × Time × Channels → bits → bytes → larger units

Key Definitions:

• Colour depth = bits per pixel | Bit depth = bits per RGB channel

• Sampling rate = samples/second | Sampling resolution = bits per sample

Nyquist's Theorem: Sample rate ≥ 2 × highest frequency