0% found this document useful (0 votes)
3 views

Compression

The document discusses data compression, defining it as the process of reducing file sizes to save storage and improve transfer speeds. It outlines two main types of compression: lossless, which retains all original data, and lossy, which sacrifices some data for higher compression ratios. Applications of compression include web services, cloud storage, and streaming, with considerations for choosing techniques based on purpose, speed, storage, and quality tolerance.

Uploaded by

haileymwenye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Compression

The document discusses data compression, defining it as the process of reducing file sizes to save storage and improve transfer speeds. It outlines two main types of compression: lossless, which retains all original data, and lossy, which sacrifices some data for higher compression ratios. Applications of compression include web services, cloud storage, and streaming, with considerations for choosing techniques based on purpose, speed, storage, and quality tolerance.

Uploaded by

haileymwenye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Compression (1.

3 KC5)
By
T.A Mubonderi
intro

 https://www.youtube.com/watch?v=XcuJukkYRA8
2.1 What is Data Compression?

 Compression is the process of reducing the file size of data to save


storage space and reduce transmission time.

Benefits of Compression:
Faster file transfer over networks.
Reduced storage space requirements.
Lower bandwidth consumption
2.2 Types of Compression
 There are two main types of compression:

 1. Lossless Compression
 Definition: Compression technique where no data is lost, and the original data can be perfectly restored.
 Common methods:
 Run-Length Encoding (RLE) – Replaces repeated values with a single value and a count.
 Example: AAAAABBBCC → 5A3B2C
 Huffman Coding – Assigns shorter binary codes to frequently used characters.
 Dictionary-Based (LZW) – Stores patterns of data in a dictionary and replaces recurring sequences with dictionary indices.
 Examples of lossless compression file formats:
 PNG (images)
 ZIP (files)
 FLAC (audio)
 Advantages:
 No loss of quality.
 Ideal for text and critical data (e.g., medical images).
 Disadvantages:
 Less effective for multimedia files with complex data patterns.
• 2. Lossy Compression

• Definition: Compression technique where some data is discarded to achieve higher compression
ratios.
• Common methods:
• JPEG (Joint Photographic Experts Group) – Reduces image quality by discarding minor details.
• MP3 (MPEG Audio Layer 3) – Removes frequencies beyond human hearing.
• MPEG (Moving Picture Experts Group) – Compresses video by discarding redundant frames.
• Examples of lossy compression file formats:
• JPEG (images)
• MP3 (audio)
• MP4 (video)
• Advantages:
• Significant reduction in file size.
• Suitable for multimedia content (e.g., music, videos).
• Disadvantages:
• Loss of data quality (may introduce artifacts).
• Not suitable for critical data (e.g., legal documents).
compare

 In 2 major groups differentiate between Lossy Compression and


Lossless Compression
2.3 Comparison of Lossy vs Lossless
Compression

 Simplify the abbreviation in 2 groups


2.4 Applications of Compression

 In twos state the application of the above concept


2.4 Applications of Compression

 Web applications: Faster loading times for web pages.


 Cloud storage: Efficient use of storage space.
 Streaming services: Reduced bandwidth usage for video/audio
streaming.
 Email attachments: Smaller file sizes for easier sharing.
 2.5 Compression Ratios
 Compression ratio measures how much the data has been reduced
compared to the original.

 Example:
Original size = 10MB, Compressed size = 2MB
Compression ratio = 102=5:1\frac{10}{2} = 5:1210​=5:1
 A higher ratio means better compression but may lead to quality loss
(for lossy methods).
2.6 Considerations for Choosing Compression
Techniques

• Purpose: Whether perfect data recovery is required.


• Speed: Faster algorithms for real-time applications.
• Storage limitations: When space is a constraint.
• Quality tolerance: Acceptable loss of quality in media files.
Summary

• Character Sets: Systems used to represent text in binary form (e.g.,


ASCII, Unicode).
• Compression: Techniques to reduce file sizes (lossless for perfect
recovery, lossy for size efficiency).
•ZIP – Zigzag Inline Package (originally derived from "zip" meaning to
compress)
•A widely used lossless compression file format that stores multiple files in a
compressed archive. ZIP files can contain a combination of compressed and
uncompressed files, making them efficient for storage and transfer.
•Example Use: Compressing documents, software packages, and backups.
•PNG – Portable Network Graphics
•A lossless image compression format that supports transparency and high-quality
graphics with no data loss. PNG is widely used for web graphics and digital design
due to its ability to retain image quality.
•Example Use: Web images, logos, and digital art where transparency is needed.
•FLAC – Free Lossless Audio Codec
•A lossless audio compression format that reduces file size without compromising
sound quality. It is popular among audiophiles and music professionals who require
high-fidelity audio.
•Example Use: Storing high-quality music collections without losing sound details.
•MP3 – MPEG Audio Layer 3
•A lossy audio compression format that reduces file size by discarding inaudible
frequencies. MP3 files provide a good balance between quality and file size, making
them ideal for music distribution.
•Example Use: Streaming and storing music on mobile devices.
•JPEG – Joint Photographic Experts Group
•A lossy image compression format that reduces file size by discarding less noticeable
image details, resulting in high compression ratios. It is commonly used for
photographs and web images.
•Example Use: Digital photography, social media uploads, and web images.
•MP4 – Moving Picture Experts Group-4 (MPEG-4 Part 14)
•A multimedia file format that can store video, audio, subtitles, and images in a
compressed format. MP4 is widely used for video streaming and playback on different
devices.
•Example Use: Streaming services (YouTube, Netflix), storing videos on mobile
devices.

You might also like