Compression

Cards (14)

  • Data compression is when we make files smaller, while trying to make the compressed file as true to the original as possible
  • Compressing data files has many uses:
    • Smaller files take up less storage space on a device
    • Streaming and downloading files from the internet is quicker as they take up less bandwidth
  • Compressing data files has many uses:
    • It allows web pages to load more quickly in web browsers
    • Email services normally have restrictions on the size of the attachment you can send - compressing the file allows you to send the same content with a much smaller file size
  • There are 2 types of compression - lossy and lossless
  • Lossy compression works by permanently removing data from the file - this limits the number of bits the file needs and so reduces its size
  • Lossless compression makes the file smaller by temporarily removing data to store the file and then restores it to its original state when it's opened
  • Examples of file types of lossy compression:
    • MP3 (audio)
    • AAC (audio)
    • JPEG (image)
  • Examples of file types of lossless compression:
    • FLAC (audio)
    • ZIP (files and folders)
    • PNG (image)
  • Advantages of lossy compression:
    • Greately reduces file size, meaning more files can be stored
    • Lossy files take up less bandwidth so can be downloaded and streamed more quickly
    • Commonly used - lots of software can read lossy files
  • Advantages of lossy compression:
    • Lossy compression loses data - the file can't be turned back into the original
    • Lossy compression can't be used on text or software files as these files need to retain all the information of the original
    • Lossy files are worse quality than the original. But, this loss in quality is normally unnoticeable
  • Advantages of lossless compression:
    • Data in only removed temporarily so there is no reduction in quality - the compressed file should look or sound like the original
    • Lossless files can be decompressed - turned back into the original
    • Lossless compression can be used on text and software files
  • Examples of file types of lossy compression:
    • MP3 (audio)
    • AAC (audio)
    • JPEG (image)
  • Disadvantages of lossless compression:
    • Only a slight reduction in file size, so lossless files still take up quite a bit of space on the device. E.g. a lossless song may have a file size around 30 MB, while the same song with lossy compression may be 5MB
  • Example
    Fiona has just heard a new band on the radio. She wants to download 50 of their songs from the internet and store them on her smartphone to take on holiday. State which type of compression would be most appropriate in this situation and explain why
    > Lossy compression would be the most appropriate. Lossy files are smaller so they would take up less bandwidth, meaning Fiona could download the songs more quickly. Their smaller file size would also allow her to store them all on her smartphone without taking up too much storage space