Calculating File Sizes (Cambridge (CIE) O Level Computer Science)

Revision Note

Robert Hampton

Expertise

Computer Science Content Creator

Calculating File Sizes

How do you calculate the size of a bitmap image?

  • Calculating the size of a bitmap image can be carried out with either of the following formulas:

    • Resolution x colour depth

    • Image width x image height x colour depth

Example

Image Files

(Resolution) x (Colour Depth)

Size of bitmap image = 

 

 

Resolution

250,000

Resolution = width x height

Colour Depth

24 bits (3 bytes)

24 bits = 3 bytes

250,000 x 24

=

(bit to bytes) /8

(bytes to KiB) /1024

6,000,000 bits

750,000 bytes

732 KiB

250000 x 3

=

(bytes to KiB) /1024

750,000 bytes

732 KiB

OR

Image Files

(Image width) x (Image height) x (Colour Depth)

Size of bitmap image = 

 

 

Image width

500

 

Image height

500

 

Colour Depth

24 bits

24 bits = 3 bytes

(500 x 500 x 24)

=

(bit to bytes) /8

(bytes to KiB) /1024

6,000,000 bits

750,000 bytes

732 KiB

(500 x 500 x 3)

=

(bytes to KiB) /1024

750,000 bytes

732 KiB

How do you calculate the size of a sound file?

  • Calculating the size of a sound file is carried out with the following formula:

    • Sample rate x duration x sample resolution

Example

Sound Files

(Sample Rate) x (Duration in seconds) (Sample Resolution)

Size of sound file = 

 

 

Sample rate

100

Samples per second

Duration

60

Seconds

Sample resolution

24

Number of bits stored per sample

100 x 60 x 24

=

(bit to bytes) /8

(bytes to KiB) /1024

144,000 bits

18,000 bytes

18 KiB

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Robert Hampton

Author: Robert Hampton

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.