RUN LENGTH
ENCODING
Presented by:
Aman Tiwari (112)
Satvik Vatsa (110)
Shekhar Borile (117)
Sharan More (093)
Tushar Pandey (085)
AGENDA
1. What is data
compression?
2. Types of data
compression
3. Run length encoding
4. Efficiency
5. Summary
WHAT IS DATA
COMPRESSION?
Data compression is the process of reducing the size of a
file or dataset by encoding its information more efficiently..
BUT WHY DO WE
NEED DATA
COMPRESSION?
• Compressed data takes less storage.
• Compressed data can be transferred
easily and efficiently.
TWO TYPES OF DATA
COMPRESSION
Lossless compression Lossy compression
• No loss of information and quality. • Some loss of information or
quality.
• Can recreate the original data from
the compressed data. • Cannot recreate the original data
• Example, GIF (Graphics
from the compressed data.
Interchange Format). • Example, JPEG (Joint
Photographic Experts Group).
5
RUN LENGTH ENCODING
•Lossless data compression
technique.
•Replaces consecutive repeated
values with a single value and a
count.
6
EXAMPLE:
7
8
RUN LENGTH ENCODING FOR
IMAGES
9
10
11
EFFICIENCY OF RUN LENGTH
ENCODING
The efficiency of RLE depends on the type of data being compressed. It
works best when there are long runs of repeated values but performs
poorly on random or highly variable data.
Compressed size
Compression Ratio=
Original
size
12
EXAMPLES ON EFFICIENCY:
Example 1 Example
3
Example
2
13
SUMMARY
•Run length encoding is lossless compression.
•Works best when data contains long runs of same
value.
•Easy to implement.
•Fast execution.
14
THANK
YOU