1.3 Data storage & compression

How computers represent text sounds and images

Data is measured in the following units:

Calculating the size of an image file:

Calculating the size of a sound file:

Compression

What is compression?

Why should we compress a file?

Difference between Lossy and Lossless Compression

When to use Lossless or Lossy Compression?

Lossless

Why would a musician choose to compress a file with lossless

  • They want to be able to edit the original sound file
  • They want the highest sound quality for the file//They want the sound to be closest to the original recording
  • …using lossy would reduce the sound quality
  • …using lossy will permanently remove some of the data//no data will be permanently removed with lossless

Lossy

Explain why lossy compression is not suitable for compressing a text file

  • Data will be permanently removed
  • …and that could be important/necessary data
  • lossy is not suitable for text files
  • …as it will damage/corrupt the file

Lossless compression of files

How is a text file compressed with lossless?

How is a video file compressed with lossless?

How is a sound file compressed with lossless?

How is an image file compressed with lossless?

Lossy compression of files

Video file

Image file

Sound file