Students are introduced to lossy compression via the Lossy Text Compression widget. They apply this concept and their prior knowledge of sampling to create their own lossy compressions of image files using the Lossy Image Widget. Students then discuss several practical scenarios where they need to decide whether to use a lossy or lossless compression algorithm. The lesson ends with a discussion of the situations where lossless compression is important and the situations where lossy compression is important.


Students will be able to:


After exploring lossless compression in yesterday's lesson, students are introduced to lossy compression. A theme throughout the lesson is that lossy compression can greatly reduce the file size, but it can also greatly reduce the quality and it's important to find that balance between quality and file size. The real challenge here is finding where that line is - how much can we compress but still keep it recognizable? In the final discussion, students compare lossy compression with lossless compression to see that each has value depending on the situation - lossy is useful when file size needs to be minimized, but lossless is important when its vital to be able to reconstruct the original image.

Getting Started


Do This: Use the Lossy Compression project and try out a few phrases.

Prompt: How is this widget similar to the widget we used yesterday? How is it different?

Discussion Goal

Students should identify that this widget is similar to yesterday's text compression widget because it also shortens text, but it is different in that some of the information is permanently lost when it is shortened. You can emphasize this point by supplying some carefully-chosen sample text and seeing that the results can be ambiguous:

"there are three tiers of tires at the shop"

Students may debate whether or not this really fits the definition of compression we saw yesterday, which is a great bridge to the next part of the lesson.



Compression Decisions

Prompt: Let's imagine we are trying to use this image for a particular purpose, and we need to decide how much compression we want to use. We will look at a series of scenarios and we will vote on how much compression is appropriate.

Teaching Tip:

After voting, briefly discuss each scenario and come to a classroom consensus on the best option.

Note that there is not necessarily one "correct answer" to these scenarios the goal here is to weigh the pros and cons and make an informed decision.

Wrap Up


  1. When is it a good idea to use lossless compression?
  2. When should you use lossy compression?
  3. What are the important factors in making that decision?

Discussion Goal

This discussion should draw out two key points:

  • Lossless compression is useful when the accuracy of the original item is most important
  • Examples: Bank records, text files, some images
  • Lossy compression is useful when file size is a concern or when it needs to be sent in a reasonable amount of time.
  • Examples: Multimedia - especially streaming media (images, video, audio)


Journal: Have students take out their journals and add the definition for lossy compression.

Assessment: Check for Understanding

Question: You've been given a new cell phone with a 2 gigabyte data plan. You plan to use your phone for text messages, images, video, and music. Which of these categories are best compressed using lossless compression? Which of these categories are best compressed using lossy compression? Why?

Standards Alignment