1/12
Lossy vs Lossless, RLE + Dictionary Based-Compression
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is compression?
the process used to reduce the file size (reduces storage space required to store the file)
Why is compression important when sharing files over networks/the internet?
larger files = longer to transfer
What is lossy compression?
the process of reducing file size while also removing unnecessary data
What is lossless compression?
the process of reducing file w/o losing any data
Where is lossy compression used?
images - JPEG
audio files - MP3
Where is lossless compression used?
high resolution images - PNG
text documents - ZIP
From what type of compression can the original file be recovered?
lossless compression
What is run length encoding (RLE)?
lossless compression - repeated data values with:
a single value
the number of occurrences
e.g.
OG data: AAARRRRRRWWWW
Compressed data: 3A6R4W
What are advantages of run length encoding (RLE)?
simple & efficient - for data w/ repeated values
lossless - og data can be reconstructed
fast & easy to implement - algorithms easy to execute
What are disadvantages of run length encoding (RLE)?
inefficient for data w/ few repeated values
limited application - only effective for certain types of data (e.g. B&W images,simple graphic files)
What is Dictionary Based Compression?
replaces repeated patterns of data with shorter codes from a dynamically built dictionary
e.g. OG data: ABABACABAC
dictionary: AB=1; AC=2;
compressed data: 11212
What are advantages of Dictionary Based compression?
efficient for larger data sets - effective compression
scalable - better for complex data (than RLE) w/ varied repetitions
widely used in formats like ZIP & PNG
What are disadvantages of Dictionary Based compression?
requires more processing power - building & managing dictionary is more computationally intensive
ineffective for very small files - dictionary may not reduce file size enough to offset dictionary’s own storage