notes

compression is used to reduce the size if the file so it:

  • takes up less storage

  • is faster to send over the internet

  • and loads faster


There are two main types of compression:

  • lossy

  • lossless


lossless compression

lossless compression reduces the file size without losing any data.


This means;

  • when a file is decompressed the exact original data is brought back.


Example idea:
If data repeats like:

AAAAAA

It could be stored as:

6A

When decompressed → AAAAAA again.

So nothing is lost.


Common uses are:

  • text files

  • programs

  • databases

  • some images


Lossy compression


lossy compression reduces the file size by removing un-noticeable data permanently.


the algorithm removes data that is less noticeable to humans


example:

  • in images→ small colour difference

  • in audio→ sounds humans struggle to hear removed


❌❌❌ Butt, once compressed , the original cannot be perfectly restored