Section1 Data Compression
Section1 Data Compression
Section1
2
Process of Data
Compression
why data compression
• 1. Storage Efficiency
• Compressed files take up less space, allowing more data to be
stored in the same amount of memory or disk.
• Useful for databases, cloud storage, and personal devices.
• 2. Faster Data Transmission
• Smaller file sizes mean quicker uploads, downloads, and
transfers over the internet or networks.
• Critical for streaming services, file sharing, and real-time
communications.
• 3. Bandwidth Optimization
• Reduces the amount of data sent over networks, preventing
congestion.
• Helps improve performance in limited-bandwidth
environments like mobile networks.
4
• 4. Cost Reduction
• Less storage and bandwidth usage translate to lower costs
for cloud services and data hosting.
• Reduces infrastructure costs for businesses handling large
amounts of data.
• 5. Improved Performance
• Applications that process large datasets (e.g., AI,
databases, and big data analytics) run faster when data is
compressed.
• Helps in gaming, multimedia streaming, and real-time
applications.
• 6. Energy Efficiency
• Smaller files require less power for storage and transfer,
contributing to lower energy consumption.
• Beneficial for data centers and mobile devices.
5
Compression Ratio
• The compression ratio quantifies how much a
data compression algorithm reduces the size of
data.
6
Data Compression Methods
• There’re two major categories for methods to
compress data: lossless and lossy methods
7
Lossless Compression
• Lossless compression is a data compression technique that
reduces file size without losing any information. This means
that the original data can be perfectly restored after
decompression.
• How It Works
8
Lossy Compression
• Lossy compression is a data compression technique that
reduces file size by permanently discarding some
data. This results in a loss of quality, but the reduction
in size is often much greater than lossless compression.
• How It Works
• Lossy compression removes data that is less
noticeable to human perception. It often works by
simplifying complex patterns, reducing color details,
or eliminating frequencies that are hard to detect.
9
• Information:
1) There will be sunrise tomorrow.
2)It’s raining today. This book has one missing
page.
3) It’s raining today. I don’t have to water my
garden now.
11
• RLE compresses data by reducing sequences of
identical values (often called runs). Instead of
storing each repeated value individually, RLE
stores a single value followed by the count of
repetitions. This method can significantly reduce
file size for data with many repeated patterns.
Example: AAAABBBCCDAA
Encode: A4B3C2D1A2
Example: 222225556777799
Encode: (2,5),(5,3),(6,1),(7,4),
(9,2)
12
RLE with Binary Image
• 0 6 3 3 2 1 5 8