M

1.2 Multimedia

Understanding bitmap images, vector graphics, and sound representation in computers

Learning Objectives

By the end of this lesson, you will be able to:

  • Show understanding of how data for a bitmapped image are encoded
  • Use and understand terms: pixel, file header, image resolution, screen resolution, colour depth, bit depth
  • Perform calculations to estimate file size for a bitmap image
  • Show understanding of effects of changing elements of a bitmap image on image quality and file size
  • Show understanding of how data for a vector graphic are encoded using terms: drawing object, property, drawing list
  • Justify use of a bitmap image or a vector graphic for a given task
  • Show understanding of how sound is represented and encoded using terms: sampling, sampling rate, sampling resolution, analogue and digital data
  • Show understanding of impact of changing sampling rate and resolution on file size and accuracy

Key Terms

Pixel

Picture element - smallest identifiable component of a bitmap image

Colour Depth

Number of bits used to represent one pixel's colour

Bit Depth

Number of bits used to store each of red, green and blue in RGB colour

Image Resolution

Number of pixels in bitmap file defined as product of width and height values

Screen Resolution

Product of width and height values for number of pixels that the screen can display

File Header

Set of bytes at beginning of a file containing information about coding used

Vector Graphic

Image using scalable shapes such as straight lines and curves defined by coordinates

Drawing List

List in vector graphic file containing commands and attributes for each object

Sampling

Taking measurements of sound amplitude at regular intervals

Sampling Rate

Number of samples taken per second (Hz)

Sampling Resolution

Number of bits used to store each sample

Analogue Data

Data obtained by measurement of a physical property which can have any value from a continuous range

Digital Data

Data stored as binary value which can have one of a discrete range of values

Graphics - Bitmap Images

Bitmap images are made up of pixels (picture elements). Each image is stored in a two dimensional matrix of pixels. Each pixel can be a small rectangle, circle, or dot. Bitmaps are also known as pixelmaps or raster graphics.

Bitmap Pixel Grid Visualization

How it works: This 16×16 grid represents a simple bitmap image. Each square is a pixel. Click on pixels to change their color. Notice how the image is built from individual colored squares.

Real-Life Example: Digital Photos

Think of photos from your smartphone:

  • Each photo is a bitmap image made of millions of pixels
  • Image resolution = width × height (e.g., 4000 × 3000 = 12 megapixels)
  • Colour depth determines how many colors each pixel can be (24-bit = 16.7 million colors)
  • When you zoom in too much, you see pixelation - individual blocks of color

Colour Depth Explained

1
1-bit (Black & White)

Each pixel is either black (0) or white (1)

8
8-bit (256 Colors)

Grayscale or limited color palette

24
24-bit (True Color)

3 bytes per pixel (RGB), 16.7 million colors

Colour Depth vs Bit Depth

Colour Depth

  • Number of bits used to represent one pixel
  • Colour depth of 8 bits per pixel provides 256 different colours
  • When colour depth increases, number of possible colours increases
  • Example: 24-bit colour depth = 3 bytes per pixel

Bit Depth

  • Number of bits used to store each of red, green and blue primary colours in RGB colour
  • Bit depth of 8 bits per primary colour provides 256 × 256 × 256 = 16,777,216 colours
  • If lower bit depth is used, image will show bands of colour
  • Note: Colour depth and bit depth terms can be used interchangeably

Resolution Concepts

Image Resolution

Number of pixels in bitmap file defined as product of width and height values

Screen Resolution

Product of width and height values for number of pixels that the screen can display

If screen resolution is smaller than image resolution, whole image cannot be shown or quality reduces

Pixel Density

Number of pixels per square inch (PPI - pixels per inch)

Bitmap File Size Calculator

Image Width (pixels):
Image Height (pixels):
Colour Depth (bits per pixel):

Formula: File Size (bits) = Width × Height × Colour Depth
Then convert to bytes (÷8), kilobytes (÷1024), megabytes (÷1024), etc.

Example Calculation from PDF

Consider a bitmap graphic needed to fill a laptop screen where resolution is 1366 by 768. If colour depth is 24 bits:

1366 × 768 × 24 = 25,178,112 bits

25,178,112 ÷ 8 = 3,147,264 bytes

3,147,264 ÷ 1024 = 3,073.5 KiB (kilobytes)

3,073.5 ÷ 1024 = approximately 3 MiB (megabytes)

Bitmap File Header

A set of bytes at beginning of a bitmap file which:

  • Identifies the file type (BMP, JPEG, PNG, etc.)
  • Contains information about the coding used
  • Defines colour depth or bit depth
  • Specifies image resolution (e.g., 100 × 100 pixels)
  • Contains information about type of compression used
  • Explains why bitmap file size is larger than the graphic alone - includes pixel data AND header information

Activity 1: Bitmap File Size Calculation

Calculate the file size for these bitmap images:

  1. A black and white image (1-bit colour depth) with resolution 640 × 480 pixels
  2. A true color image (24-bit colour depth) with resolution 1920 × 1080 pixels
  3. An image with 8-bit colour depth, resolution 800 × 600 pixels

Give your answers in kilobytes (KiB) or megabytes (MiB) as appropriate.

Solution:
  1. 640 × 480 × 1 = 307,200 bits
    307,200 ÷ 8 = 38,400 bytes
    38,400 ÷ 1024 = 37.5 KiB
  2. 1920 × 1080 × 24 = 49,766,400 bits
    49,766,400 ÷ 8 = 6,220,800 bytes
    6,220,800 ÷ 1024 = 6,075 KiB
    6,075 ÷ 1024 = 5.93 MiB
  3. 800 × 600 × 8 = 3,840,000 bits
    3,840,000 ÷ 8 = 480,000 bytes
    480,000 ÷ 1024 = 468.75 KiB

Activity 2: Bitmap Quality Analysis

Analyze these scenarios and explain what happens to image quality and file size:

  1. A 1024 × 768 image with 24-bit colour depth is displayed on a 800 × 600 screen
  2. The same image is zoomed in to 400% on screen
  3. The image's colour depth is reduced from 24-bit to 8-bit
  4. The image resolution is doubled (2048 × 1536) but colour depth stays the same
Solution:
  1. Screen resolution smaller than image: Whole image cannot be shown, or it's scaled down losing detail. Quality may appear reduced if scaling algorithm is poor.
  2. Zooming in 400%: Pixels are stretched, making image look blocky and pixelated. Quality becomes poor as individual pixels become visible.
  3. Reduced colour depth: Number of colors reduces from 16.7 million to 256. Image may show color bands (posterization) where smooth gradients become steps. File size reduces by factor of 3.
  4. Doubled resolution: Image quality improves (more detail), but file size quadruples (4× larger) because both width and height doubled.

Check Your Understanding: Bitmap Images

Answer
  • [1 mark] Pixel stands for "picture element"
  • [1 mark] It is the smallest identifiable component of a bitmap image
  • [Additional] Defined by just two properties: its position in the bitmap matrix and its colour
Answer
  • [1 mark] Bitmap images are organized as a grid of coloured squares called pixels
  • [1 mark] When zooming in, the number of pixels in the image does not change
  • [1 mark] Pixels are stretched and made into larger blocks, making individual pixels visible
  • [Additional] This causes the image to look "blocky" and lose detail
Answer
  • [1 mark] Colour depth: Number of bits used to represent one pixel's colour
  • [1 mark] Bit depth: Number of bits used to store each of red, green and blue primary colours in RGB
  • [1 mark] Note: The terms can be used interchangeably in many contexts
  • [Additional] Example: 24-bit colour depth usually means 8 bits for each RGB component
Answer
  • [1 mark] Total pixels = 1600 × 1200 = 1,920,000 pixels
  • [1 mark] Total bits = 1,920,000 × 16 = 30,720,000 bits
  • [1 mark] File size = 30,720,000 ÷ 8 = 3,840,000 bytes = 3,840,000 ÷ 1024 = 3,750 KiB = 3.66 MiB
Answer
  • [1 mark] File type identification
  • [1 mark] Colour depth/bit depth information
  • [1 mark] Image resolution and dimensions
  • [Additional] Type of compression used, coding information

Vector Graphics

Vector graphics use scalable shapes such as straight lines and curves, using coordinates and geometry to precisely define the parts of the image. Unlike bitmap images made of pixels, vector graphics are defined by mathematical equations.

Vector Graphics Visualization

How it works: Vector graphics are defined by mathematical equations. Click "Scale Up" to see how vector graphics maintain quality when resized, unlike bitmap images.

Real-Life Example: Logos & Icons

Think of company logos or app icons:

  • Logos need to look sharp at any size (business card to billboard)
  • Vector graphics can be scaled infinitely without quality loss
  • File sizes are much smaller than equivalent bitmaps
  • Examples: SVG files for websites, Adobe Illustrator files, CAD drawings

When designing a logo for a company, vector graphics are the best choice!

Drawing List Structure

A vector graphic contains a drawing list in the file header:

C
Command

Used for each object (line, circle, rectangle, etc.)

A
Attributes

Properties that make up each object (color, thickness, etc.)

P
Relative Position

Position of each object relative to others

How Vector Graphics Work

When Vector Graphic is Displayed

  1. File is read and drawing list is processed
  2. Appropriate calculations are made based on mathematical equations
  3. Objects are drawn to a suitable scale on the display
  4. If user requests larger scale, file is read again and new calculations made
  5. This avoids image distortion - no squashing or stretching

Vector graphic file can only be displayed directly on a graph plotter. For other displays, it must be converted to a bitmap.

Vector Graphics vs Bitmap Images

Vector Graphic Images Bitmap Images
Made up of geometric shapes which require definition/attributes Made up of tiny pixels of different colours
To alter/edit the design, change each geometric shape Possible to alter/edit each pixel to change the design
Do not require large file size (simple geometric shapes) File size is very large (pixels give accurate designs)
Number of geometric shapes is limited, so not usually very realistic Images built pixel by pixel, so final image is usually very realistic
File formats: .svg, .cgm, .odg File formats: .jpeg, .bmp, .png

Use Vector Graphics When:

  • Designing logos for companies
  • Creating 'exploded diagrams' of mechanical parts
  • Architectural, engineering or manufacturing design
  • Image needs to be resized/scaled frequently
  • Image needs to be drawn to scale
  • Small file size is important

Use Bitmap Images When:

  • Digital photos from cameras or smartphones
  • Complex images with fine detail (photographs)
  • Inserting images into documents, publications or web pages
  • Images with complex color gradients
  • Realistic images are required
  • Editing individual pixels is necessary

Note: A digital camera automatically produces a bitmap.

Activity 3: Choosing Image Format

For each scenario, state whether you would use a bitmap image or vector graphic, and explain why:

  1. A company logo that needs to be printed on business cards and billboards
  2. A photograph taken on a smartphone for a social media post
  3. An architectural floor plan that needs to be scaled to different sizes
  4. A digital painting with complex color blending and textures
  5. A simple icon for a mobile app that needs to look sharp at different sizes
Solution:
  1. Vector graphic - Logos need to scale to different sizes without quality loss. Vector graphics maintain sharp edges at any size.
  2. Bitmap image - Photographs from digital cameras are naturally bitmap images with complex detail that vector graphics can't represent well.
  3. Vector graphic - Architectural plans need precise scaling. Vector graphics can be resized without distortion and maintain accurate measurements.
  4. Bitmap image - Complex color blending and textures are best represented by pixels. Vector graphics struggle with photorealistic effects.
  5. Vector graphic - Icons need to look sharp at different sizes on different screen resolutions. Vector graphics scale perfectly.

Check Your Understanding: Vector Graphics

Answer
  • [1 mark] Image that uses scalable shapes such as straight lines and curves
  • [1 mark] Uses coordinates and geometry to precisely define parts of the image
  • [Additional] Contains a drawing list with commands and attributes for each object
Answer
  • [1 mark] Vector graphics are defined by mathematical equations, not fixed pixels
  • [1 mark] When scaled, the equations are recalculated for the new size
  • [1 mark] No pixels are stretched - shapes remain mathematically precise
  • [Additional] The drawing list is reprocessed to create the image at new scale
Answer
  • [1 mark] List included in file header of vector graphic
  • [1 mark] Contains commands used for each object that makes up the graphic
  • [1 mark] Includes attributes that define properties of each object
  • [Additional] Also includes relative positions of objects to each other
Answer
  • [1 mark] Made up of simple geometric shapes defined by mathematical equations, not millions of pixels
  • [1 mark] Only stores commands and attributes for objects, not color information for every pixel
Answer
  • [1 mark] When printing using a laser or inkjet printer
  • [1 mark] For display on screens that don't support vector graphic rendering
  • [Additional] Vector graphics can only be displayed directly on a graph plotter

Sound Representation

Sound cannot travel in a vacuum. It requires a medium to travel and is transmitted by causing oscillations of particles within the medium. Human ear picks up these oscillations (changes in air pressure) and interprets them as sound.

Sound Sampling Visualization

How it works: This shows analogue sound being converted to digital. The wave represents continuous sound, dots show samples taken at regular intervals, and lines show quantization (assigning digital values).

Real-Life Example: Music Streaming

Think of streaming music on Spotify or YouTube:

  • Original sound is analogue (continuous air pressure changes)
  • Must be converted to digital for computer storage/transmission
  • Sampling rate determines how often sound is measured (e.g., 44.1 kHz for CD quality)
  • Sampling resolution determines how accurately each sample is stored (e.g., 16-bit for CD quality)
  • Higher values = better quality but larger file sizes

Sound Transmission Process

F
Band-Limiting Filter

Removes high frequency components humans can't hear

A
Analogue-to-Digital Converter (ADC)

Converts analogue sound measurements to digital binary values

S
Sampling

Taking measurements of sound amplitude at regular intervals

Key Sound Concepts

Analogue Data

Data obtained by measurement of a physical property which can have any value from a continuous range of values

Digital Data

Data stored as a binary value which can have one of a discrete range of values

Nyquist's Theorem

Sampling must be done at a frequency at least twice the highest frequency of the sound

Sampling Rate

  • Number of samples taken per second (measured in Hz)
  • Increasing sampling rate increases accuracy/precision of digitised sound
  • Results in smaller quantization errors
  • CD quality: 44.1 kHz (44,100 samples per second)
  • Must follow Nyquist's theorem: ≥ 2 × highest frequency

Sampling Resolution

  • Number of bits used to store each sample
  • Larger sampling resolution means more values available to store each sample
  • Improves accuracy of digitised sound and decreases distortion
  • Increased sampling resolution means smaller quantization error
  • CD quality: 16-bit (65,536 possible values per sample)

Pros and Cons of Larger Sampling Resolution

Pros Cons
Larger dynamic range Produces larger file size
Better sound quality Takes longer to transmit/download sound files
Less sound distortion Requires greater processing power

Sound File Size Calculator

Sampling Rate (Hz):
Sampling Resolution (bits):
Duration (seconds):
Channels:

Formula: File Size (bits) = Sampling Rate × Sampling Resolution × Duration × Channels
Then convert to bytes, kilobytes, megabytes, etc.

Example Calculation from PDF

Audio is being sampled at 44.1 kHz using 8 bits. Two channels (Stereo) are being used. Calculate size of a 30-second recording:

File size = 44,100 × 8 × 30 × 2 = 21,168,000 bits

21,168,000 ÷ 8 = 2,646,000 bytes

2,646,000 ÷ (1024 × 1024) = 2.5 MiB

Features of Sound Editor Software

  • Edit start/stop times and duration of a sample
  • Extract and save (or delete) part of a sample
  • Alter the frequency and amplitude of a sample
  • Fade in and fade out effects
  • Mix and/or merge multiple sound tracks or sources
  • Combine various sound sources and alter their properties
  • Remove 'noise' to enhance one sound wave
  • Convert between different audio formats

Activity 4: Sound File Calculations

Calculate file sizes for these audio recordings:

  1. A 3-minute song at CD quality (44.1 kHz, 16-bit, stereo)
  2. A 10-second telephone message (8 kHz, 8-bit, mono)
  3. A 5-minute podcast recorded at studio quality (96 kHz, 24-bit, stereo)

Give your answers in megabytes (MiB) as appropriate.

Solution:
  1. 44,100 × 16 × 180 × 2 = 254,016,000 bits
    254,016,000 ÷ 8 = 31,752,000 bytes
    31,752,000 ÷ (1024×1024) = 30.28 MiB
  2. 8,000 × 8 × 10 × 1 = 640,000 bits
    640,000 ÷ 8 = 80,000 bytes
    80,000 ÷ 1024 = 78.13 KiB (0.076 MiB)
  3. 96,000 × 24 × 300 × 2 = 1,382,400,000 bits
    1,382,400,000 ÷ 8 = 172,800,000 bytes
    172,800,000 ÷ (1024×1024) = 164.79 MiB

Check Your Understanding: Sound Representation

Answer
  • [1 mark] Taking measurements of sound amplitude at regular intervals
  • [1 mark] Storing the measured values as digital data
  • [Additional] Converts continuous analogue sound to discrete digital values
Answer
Sampling Rate:
  • Number of samples taken per second
  • Measured in Hz (e.g., 44,100 Hz)
  • Affects frequency accuracy
  • Higher rate = more accurate
Sampling Resolution:
  • Number of bits used to store each sample
  • e.g., 8-bit, 16-bit, 24-bit
  • Affects amplitude accuracy
  • Higher resolution = less distortion
Answer
  • [1 mark] States that sampling must be done at a frequency at least twice the highest frequency of the sound
  • [1 mark] Ensures accurate reconstruction of the original sound
  • [1 mark] Prevents aliasing (false frequencies appearing in sampled sound)
  • [Additional] Example: To sample 20 kHz sound, need at least 40 kHz sampling rate
Answer
  • [1 mark] 48,000 × 24 × 120 × 2 = 276,480,000 bits
  • [1 mark] 276,480,000 ÷ 8 = 34,560,000 bytes
  • [1 mark] 34,560,000 ÷ (1024×1024) = 32.96 MiB
Answer
  • [1 mark] Removes high frequency components that human ear cannot detect
  • [1 mark] Prevents problems during coding/aliasing that these frequencies could cause
  • [Additional] Helps ensure Nyquist theorem can be followed with practical sampling rates

Key Takeaways

  • Bitmap images are made of pixels - each has a colour and position in a grid
  • Colour depth determines how many colours a pixel can represent (1-bit = B&W, 8-bit = 256 colours, 24-bit = 16.7 million colours)
  • Image resolution = width × height in pixels. Higher resolution = more detail but larger file size
  • Bitmap images pixelate when zoomed because pixels are stretched into larger blocks
  • File size calculation: Width × Height × Colour Depth (in bits), then convert to bytes/KB/MB
  • Vector graphics use mathematical equations to define shapes, not pixels
  • Vector graphics scale perfectly without quality loss because equations are recalculated
  • Use vector graphics for logos, diagrams, drawings that need scaling
  • Use bitmap images for photographs and complex realistic images
  • Sound is converted from analogue to digital through sampling (measuring amplitude at intervals)
  • Sampling rate = measurements per second (Hz). Higher rate = better frequency accuracy
  • Sampling resolution = bits per sample. Higher resolution = better amplitude accuracy, less distortion
  • Nyquist theorem: Sample at ≥ 2 × highest frequency to accurately reconstruct sound
  • Sound file size calculation: Sampling Rate × Resolution × Duration × Channels
  • Higher quality multimedia = larger file sizes = more storage needed, longer transmission times

Question Bank

Marking Scheme & Answer
  • [1 mark] Bitmap images are made up of pixels (picture elements)
  • [1 mark] Image is stored as a two-dimensional matrix of pixels
  • [1 mark] Each pixel is defined by its position in the matrix and its colour
  • [1 mark] Colour is represented using colour depth (number of bits per pixel)
  • [Additional] File includes header information and pixel data
Marking Scheme & Answer
  • [1 mark] Total pixels = 1920 × 1080 = 2,073,600
  • [1 mark] Total bits = 2,073,600 × 32 = 66,355,200 bits
  • [1 mark] Bytes = 66,355,200 ÷ 8 = 8,294,400 bytes
  • [1 mark] MiB = 8,294,400 ÷ (1024×1024) = 7.91 MiB
Marking Scheme & Answer
Bitmap Images:
  • Made of pixels in a grid
  • Pixelate when zoomed
  • Large file sizes
  • Realistic images
  • Formats: JPEG, BMP, PNG
  • Good for photographs
Vector Graphics:
  • Made of mathematical equations
  • Scale without quality loss
  • Small file sizes
  • Not very realistic
  • Formats: SVG, CGM, ODG
  • Good for logos, diagrams
Marking Scheme & Answer
  1. [1 mark] Analogue sound signal enters sound encoder
  2. [1 mark] Band-limiting filter removes high frequencies humans can't hear
  3. [1 mark] Sampling: Measurements taken at regular intervals (sampling rate)
  4. [1 mark] Each sample's amplitude is measured and converted to digital value (sampling resolution)
  5. [1 mark] Digital values stored as binary data for computer processing/storage
Marking Scheme & Answer
  • [1 mark] Total pixels = 1500 × 3000 = 4,500,000
  • [1 mark] 8 bytes = 64 bits (since 1 byte = 8 bits)
  • [1 mark] File size = (4,500,000 × 64) ÷ 8 = 36,000,000 bytes = 36 MB
  • [Note] Question says "bit depth of 8 bytes" which is unusual - normally measured in bits. Assuming they mean 8 bytes per pixel = 64 bits per pixel.
Marking Scheme & Answer
Increasing Sampling Rate:
  • Improves frequency accuracy
  • Reduces quantization error
  • Increases file size proportionally
  • Better reproduction of high frequencies
Increasing Sampling Resolution:
  • Improves amplitude accuracy
  • Reduces distortion
  • Increases file size proportionally
  • Better dynamic range

Both higher sampling rate and resolution improve sound quality but increase file size.

Marking Scheme & Answer
  • [1 mark] Logos need to be used at different sizes (business cards to billboards)
  • [1 mark] Vector graphics scale without quality loss - edges remain sharp at any size
  • [1 mark] Bitmap images would pixelate when enlarged, losing quality
  • [Additional] Vector files are smaller and easier to edit (change colors, shapes)
Marking Scheme & Answer
  • [1 mark] Pixels per photo = 1024 × 1536 = 1,572,864
  • [1 mark] Bits per photo = 1,572,864 × 24 = 37,748,736 bits
  • [1 mark] Bytes per photo = 37,748,736 ÷ 8 = 4,718,592 bytes
  • [1 mark] 16 GiB = 16 × 1024 × 1024 × 1024 = 17,179,869,184 bytes
    Number of photos = 17,179,869,184 ÷ 4,718,592 = 3,640 photos
Marking Scheme & Answer
  • [1 mark] Identifies the file type so operating system and software know what to do with it
  • [1 mark] Contains information about the coding used (colour depth, resolution, compression)
  • [1 mark] Acts as a 'signature' for the file format
  • [Additional] Applications use file header to verify file types before processing
Marking Scheme & Answer
  • [1 mark] Total pixels = 1920 × 1536 = 2,949,120
  • [1 mark] Total bits = 2,949,120 × 16 = 47,185,920 bits
  • [1 mark] MiB = 47,185,920 ÷ 8 ÷ (1024×1024) = 5.625 MiB