0% found this document useful (0 votes)
9 views11 pages

Compression Algorithms: Lesson 13

Lesson 13 of AP Computer Science Principles focuses on compression algorithms, highlighting their importance in saving time, space, and complexity. It distinguishes between lossy and lossless compression, explaining that lossy compression results in some loss of information while lossless retains all data. The lesson also discusses the characteristics of effective compression algorithms and the necessity of evaluating their efficiency.

Uploaded by

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

Compression Algorithms: Lesson 13

Lesson 13 of AP Computer Science Principles focuses on compression algorithms, highlighting their importance in saving time, space, and complexity. It distinguishes between lossy and lossless compression, explaining that lossy compression results in some loss of information while lossless retains all data. The lesson also discusses the characteristics of effective compression algorithms and the necessity of evaluating their efficiency.

Uploaded by

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

AP COMPUTER SCIENCE PRINCIPLES UNIT 4

Compression Algorithms
LESSON 13:
Lesson 13: Compression Algorithms

Compression

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Need for compression


Saves time, space, complexity

Less Efficient More Efficient

5x5x5x5x5x5x5 57

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Read and Watch – Compressed websites

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Evaluating Compression Algorithms


Important characteristics of useful compression “algorithms”:

● the process/ procedure nature of algorithms allows for the act of


transforming the text

● the consistency of algorithms ensures the reliability of results


(always the same result).

● The fact that algorithms are ordered processes implies


reversibility, so that the compressed text can be decompressed
(not guaranteed - only for lossless).

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Comparing Compression Algorithms

5x5x5 53

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Not all data can be Compressed

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Lossy vs. Lossless


Lossy - loss of information with
compression

Lossless - no loss of information


with compression

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Lossy Compression – Image Example

Original Image Compressed Image Compressed Image


(175KB size) (25KB size, 85% less (11KB size, 94% less
information) information)

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Why use lossy?


● Greater reductions of file size

● Offers the best compression ratios

● For a “good enough” approximation

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4


Lesson 13: Compression Algorithms

Compression Recap
1. Why is compression an important factor when
dealing with media?

2. How does the lossy vs. lossless tradeoff affect how you
consume media?

AP COMPUTER SCIENCE PRINCIPLES | UNIT 4

You might also like