Save
OCR Computer Science
Lossy and Lossless Compression
Save
Share
Learn
Content
Leaderboard
Learn
Created by
zara k
Visit profile
Cards (11)
Compression
Reducing file size while
retaining
the core information
Compression means fewer bits are needed to represent the same information, reducing
storage space
and
transfer times
Two approaches to compression
Lossy
Lossless
Lossy compression
The algorithm physically removes data from the file, reducing file
size
but losing some
data
Lossy compression algorithms
JPEG
for images
MP3
for audio
Lossy compression
Removes data that humans are
least
likely to recognize or
notice
Lossless compression
Rearranges
data to make it more efficient without
deleting
any data
Run Length Encoding (
RLE
)
Replace long runs of
repeated
data with
frequency-data pairs
RLE example with image data
4 yellow
1 blue
4 purple
1 blue
RLE example with binary data
5
zeros
4
ones
1
zero
RLE works best with data likely to have lots of
repeats
, like
images
or matrices, but may not be effective for random or varied data