We’re moving to a new home! Our website is currently in test mode while we update and transfer our content. Some pages and resources may be temporarily unavailable. We’ll be back with all resources shortly. Thank you for your patience.

CIE IGCSE | 1.3.2 Calculating Image and Sound File Size

Lesson objective

Calculate uncompressed image and sound data sizes. Select the correct formula, convert duration to seconds and express results in bytes, KiB or MiB using 1024.

Learn

1.3.2 | CALCULATING IMAGE AND SOUND FILE SIZE

01 | WHAT ARE WE CALCULATING?

Why can a short sound recording use more storage than a photograph? The answer depends on how much data is recorded and how many bits represent each piece.

In this lesson, calculate uncompressed pixel data or uncompressed sampled sound data. These simple models exclude file headers, metadata, palettes, padding and other overhead. Actual compressed file sizes cannot be found from these formulas alone.

Both methods give bits first. Convert the answer into the unit the question requests.

02 | IMAGE SIZE: COUNT THE PIXELS

A bitmap is a rectangular grid. Multiply width by height to find the number of pixels, then multiply by colour depth to count the bits.

Image data in bits
= width in pixels × height in pixels × colour depth in bits per pixel
Build the image formula from its meaning
FactorWhat it counts
Width × heightTotal number of pixels
Colour depthBits used to represent each pixel
Their productBits used for all pixel values

Use bits per pixel, not the number of possible colours. An 8-bit image can represent 256 colour values, but the formula uses 8, not 256.

03 | WORKED IMAGE EXAMPLE

A bitmap is 640 pixels wide and 480 pixels high, with a colour depth of 8 bits per pixel. Calculate its uncompressed pixel data size in KiB.

Pixels: 640 × 480 = 307200
Bits: 307200 × 8 = 2457600 bits
Bytes: 2457600 ÷ 8 = 307200 bytes
KiB: 307200 ÷ 1024 = 300 KiB

The two appearances of 8 have different jobs: colour depth tells us bits per pixel; dividing by 8 converts bits to bytes. They cancel in this example because each pixel uses exactly one byte.

04 | A HIGHER COLOUR DEPTH

Keep the same 640 × 480 resolution but use 24 bits per pixel instead.

640 × 480 × 24 = 7372800 bits
7372800 ÷ 8 = 921600 bytes
921600 ÷ 1024 = 900 KiB

The colour depth tripled from 8 to 24, so the raw size tripled from 300 to 900 KiB. The image still has the same number of pixels.

Doubling width alone doubles size. Doubling both width and height multiplies size by four. Doubling colour depth doubles size, with everything else fixed.

05 | SOUND SIZE: COUNT THE SAMPLES

Sample rate is the number of samples recorded each second. Multiply it by duration in seconds to count the samples. Sample resolution, also called bit depth, tells us how many bits represent each sample.

Mono sound data in bits
= sample rate in Hz × duration in seconds × sample resolution in bits
Build the sound formula from its meaning
FactorMeaning
Sample rate × durationTotal samples in one channel
Sample resolution / bit depthBits per sample
ProductTotal bits for mono sound

A rate of 8 kHz is 8000 Hz. The kilo in kHz means 1000, even though storage conversions in this syllabus use 1024. Frequency and storage prefixes are different things.

06 | WORKED MONO SOUND EXAMPLE

A 10-second mono recording uses a sample rate of 8000 Hz and a sample resolution of 16 bits. Calculate its raw size in KiB.

Samples: 8000 × 10 = 80000
Bits: 80000 × 16 = 1280000 bits
Bytes: 1280000 ÷ 8 = 160000 bytes
KiB: 160000 ÷ 1024 = 156.25 KiB

Keep full precision as you work. A fractional number of KiB is valid.

07 | MINUTES MUST BECOME SECONDS

A 2-minute mono recording uses 32768 Hz and 16 bits per sample. Calculate the size in MiB.

Duration: 2 × 60 = 120 seconds
Bits: 32768 × 120 × 16 = 62914560 bits
Bytes: 62914560 ÷ 8 = 7864320 bytes
KiB: 7864320 ÷ 1024 = 7680 KiB
MiB: 7680 ÷ 1024 = 7.5 MiB

Using 2 instead of 120 would make the answer 60 times too small. Write the converted duration before substituting into the formula.

08 | CHANNELS AND CHANGING SETTINGS

The core formula above assumes mono: one channel. If a question specifies several equally sampled channels, multiply by the number of channels. Stereo has two channels, so it uses twice the mono data at the same rate, depth and duration.

Sound bits = rate × seconds × bits per sample × channels

This is an extension to the mono model. Do not add a factor of two unless stereo or two channels is specified.

Predict size before calculating
Change, with other settings fixedEffect on raw data
Double sample rateDouble the size
Double sample resolutionDouble the size
Double durationDouble the size
Double rate and resolutionFour times the size

Higher settings can represent sound more accurately, but increasing them does not recover detail missing from a poor original recording.

09 | TRY THE FILE SIZE CALCULATORS

Predict the result, then use the calculators to check. They calculate raw data only, using 1024 for storage units.

IMAGE PIXEL DATA

SOUND SAMPLE DATA

Decimal display is rounded to 12 significant digits where necessary. Fractions of bytes can arise from raw bit counts; actual files use whole bytes and may include padding.

10 | AVOID THE COMMON TRAPS

Use the right depth: colour depth for an image, sample resolution for sound. Use seconds: convert minutes first. Convert bits: divide by 8 before converting bytes to KiB. Use 1024: for each binary storage step. State the unit: it is part of the answer.

Do not multiply by compression settings unless the question gives enough information to calculate a compressed size. A JPEG or MP3 file usually differs from the raw size because its representation uses compression.

MATCH THE IMAGE TERM

Terminology

Terminology

Image resolution

The pixel dimensions of an image; width × height gives the pixel count.

Colour depth

The number of bits used per pixel in the image model.

Sample rate

The number of samples recorded per second, measured in Hz.

Sample resolution

The number of bits used to represent each sound sample; also called bit depth.

Duration

The recording length, expressed in seconds for the formula.

Mono

Sound with one channel.

Stereo

Sound with two channels.

Raw data size

The size before compression and additional file information are included.

Byte

8 bits.

Kibibyte (KiB)

1024 bytes.

Mebibyte (MiB)

1024 KiB, or 1048576 bytes.

File overhead

Additional stored information such as headers and metadata.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which expression gives raw image data in bits?
2. A 128 × 128 image uses 8 bits per pixel. What is its size?
3. Which values belong in a mono sound calculation?
4. A recording lasts 1.5 minutes. Which duration should you use?
5. What happens when both image dimensions double?
6. A sound clip is 4096 Hz, 8-bit, mono and 2 seconds long. What is its size?
7. Which statements are correct?
8. Which assumptions affect the result?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Calculate the raw size in KiB of a 256 × 128 image at 16 bits per pixel.

2. Calculate the raw size in MiB of a 1024 × 512 image at 24 bits per pixel.

3. Calculate a 5-second mono recording at 16384 Hz and 16 bits per sample in KiB.

4. Calculate a 1-minute mono recording at 8192 Hz and 8 bits per sample in KiB.

5. An image doubles both dimensions and changes depth from 8 to 16 bits. Explain the size factor.

6. Explain why an actual compressed image file may differ from your calculated size.

DEBUG THE WORKING

A student calculates a 2-minute mono recording at 8192 Hz and 16-bit resolution as: 8192 × 2 × 16 ÷ 1024 = 256 KiB. Find two mistakes before revealing the answer.

Reveal correction

Convert 2 minutes to 120 seconds, and divide the bit count by 8 before converting to KiB. Correct result: 8192 × 120 × 16 ÷ 8 ÷ 1024 = 1920 KiB.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

    Selections are kept while this page is open.

    Workbook

    Workbook

    COMING SOON

    The workbook for 1.3.2 Calculating Image and Sound File Size is coming soon. Complete the worked calculations and written tasks in your exercise book.