data compression
data compression
Computer Science
Data Storage & Compression
Contents
Units of Data Storage
Calculating File Sizes
Compression
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 1
Units of Data Storage
Your notes
Units of Data Storage
What are units of data storage?
A unit of data is a term given to describe different amounts of binary digits stored on a
digital device
These are the units you need to know for IGCSE:
Bit b 1 or 0
Nibble 4b
Byte B 8b
Megabyte vs Mebibyte
1 kibibyte (1KiB) = 1024 bytes (1024 B) - binary prefixes (to the power of 2)
1 kilobyte (1KB) = 1000 bytes (1000 B) - decimal prefixes (to the power of 10)
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 2
For example, 24 bits in bytes would be 24 / 8 = 3 B and 10 bytes in bits would be 10 * 8 =
80 b
Your notes
Unit
Byte
Mebibyte
Gibibyte
Tebibyte
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 3
Calculating File Sizes
Your notes
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
OR
Image Files
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 4
Image height 500
Your notes
Colour Depth 24 bits 24 bits = 3 bytes
Example
Sound Files
Duration 60 Seconds
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 5
Compression
Your notes
The Need For Compression
What is compression?
Compression is reducing the size of a file so that it takes up less space on secondary
storage
The impact of compression is:
Less storage space required
Less bandwidth required
Shorter transmission time
Compression can be achieved using two methods, lossy and lossless
Lossy Compression
What is lossy compression?
Lossy compression is when data is lost in order to reduce the size on secondary storage
Lossy compression is irreversible
Lossy can greatly reduce the size of a file but at the expense of losing quality
Lossy is only suitable for data where reducing quality is acceptable, for example
images, video and sound
In photographs, lossy compression will try to group similar colours together, reducing
the amount of colours in the image without compromising the overall quality of the
image
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 6
Your notes
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 7
Your notes
Lossless Compression
What is lossless compression?
Lossless compression is when data is encoded in order to reduce the size on secondary
storage
Lossless compression is reversible, the file can be returned to its original state
Lossless can reduce the size of a file but not as dramatically as lossy
Lossless can be used on all data but is more suitable for data where a loss in quality is
unacceptable, for example documents
In a document, lossless compression algorithms such as run length encoding (RLE) can
be used to analyse the contents looking for patterns and repetition.
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 8
For example, a line in an image with 5 red pixels followed by 3 blue pixels could be
represented as "5R3B"
Lossless file formats Your notes
Worked Example
An email is sent containing a sound file.
Lossy compression is used to compress the sound file.
Explain two reasons why using lossy compression is beneficial. [4]
How to answer this question
What are the differences between lossy and lossless?
Can you state two differences? [2 marks]
Can you say why each point is a benefit? [2 marks]
Answer
Lossy will decrease the file size [1]
...so it can sent via email quicker [1]
Lossy means data is lost [1]
...the difference is unlikely to be noticed by humans [1]
© 2025 Save My Exams, Ltd. Get more and ace your exams at savemyexams.com 9