Skip to content
Computer Science · Grade 10 · Data and Information Systems · Term 2

Data Compression Techniques

Investigate methods used to reduce the size of digital files, including lossless and lossy compression.

Ontario Curriculum ExpectationsCS.HS.D.2CS.HS.D.3

About This Topic

Data compression techniques shrink digital files for storage and transfer while managing information loss. Lossless methods, such as ZIP archives or PNG images, eliminate redundancies to reduce size without altering original data, allowing full recovery. Lossy methods, like JPEG for photos or MP3 for audio, remove details humans barely notice, achieving smaller files at the cost of some quality.

In Ontario's Grade 10 Computer Science curriculum, under Data and Information Systems, students differentiate these approaches, analyze trade-offs between size reduction and fidelity, and justify selections for data types like text, graphics, or video. This builds skills in evaluating real-world systems, from email attachments to streaming services.

Active learning suits this topic perfectly. Students compress sample files with free tools, measure sizes, assess quality through blind tests, and debate uses, turning abstract algorithms into observable outcomes. Collaborative analysis sharpens critical thinking and reveals context-specific decisions.

Key Questions

  1. Differentiate between lossless and lossy compression techniques.
  2. Analyze the trade-offs between file size reduction and data quality.
  3. Justify the choice of a specific compression method for different types of data.

Learning Objectives

  • Compare the compression ratios achieved by lossless and lossy compression algorithms on various file types.
  • Evaluate the impact of different compression levels on image and audio quality using subjective and objective measures.
  • Justify the selection of a specific compression technique (e.g., ZIP, JPEG, MP3) for given data types and use cases.
  • Explain the fundamental principles behind Huffman coding and run-length encoding for lossless compression.
  • Analyze the trade-offs between file size reduction, processing time, and data fidelity for different compression methods.

Before You Start

Introduction to File Types and Data Representation

Why: Students need a basic understanding of how different types of digital data (text, images, audio) are represented to grasp why compression methods vary.

Basic Computer Operations and File Management

Why: Familiarity with saving, opening, and managing files is necessary for students to practically apply compression tools.

Key Vocabulary

Lossless CompressionA data compression method that allows the original data to be perfectly reconstructed from the compressed data. Examples include ZIP and PNG.
Lossy CompressionA data compression method that reduces file size by discarding some data that is considered less important or imperceptible to humans. Examples include JPEG and MP3.
Compression RatioThe ratio of the original file size to the compressed file size, indicating how much the file has been reduced.
RedundancyRepetitive patterns or information within data that can be identified and removed or represented more efficiently during compression.
Perceptual CodingA technique used in lossy compression that exploits the limitations of human perception (sight and hearing) to remove data that is unlikely to be noticed.

Watch Out for These Misconceptions

Common MisconceptionAll compression discards original data permanently.

What to Teach Instead

Lossless techniques fully reconstruct data; only lossy sacrifices details. Hands-on tests with text files show identical outputs post-unzipping, while image diffs reveal lossy changes. Group comparisons correct this through shared evidence.

Common MisconceptionLossy compression always produces poor quality.

What to Teach Instead

Quality depends on ratio; moderate lossy often suffices for viewing. Blind audio tests in pairs help students hear subtle differences and plot acceptable thresholds, building nuanced judgment.

Common MisconceptionCompression works the same for every file type.

What to Teach Instead

Algorithms suit data structures, like run-length for images. Experiments across types reveal varying ratios; small group rotations expose patterns and justify tailored choices.

Active Learning Ideas

See all activities

Real-World Connections

  • Video streaming services like Netflix and YouTube use sophisticated lossy compression algorithms (e.g., H.264, VP9) to deliver high-definition content over varying internet speeds, balancing quality with bandwidth requirements.
  • Digital photographers often choose JPEG format for its significant file size reduction, allowing more images to be stored on memory cards and transferred quickly, while understanding that some image detail is permanently lost.
  • Software developers use lossless compression tools like ZIP or GZIP to package applications and distribute them efficiently, ensuring that all original program files are intact upon extraction.

Assessment Ideas

Quick Check

Present students with three scenarios: compressing a text document for email, compressing a photograph for a website, and compressing an audio file for a podcast. Ask them to identify which type of compression (lossless or lossy) would be most appropriate for each and provide a one-sentence justification.

Exit Ticket

On an index card, have students define 'lossless compression' in their own words and provide one example of a file type or situation where it is essential. Then, ask them to define 'lossy compression' and provide one example where it is commonly used.

Discussion Prompt

Facilitate a class discussion using the prompt: 'Imagine you are designing a new online photo-sharing platform. What are the key factors you would consider when deciding whether to automatically compress user-uploaded images using a lossy method, and what are the potential benefits and drawbacks for your users?'

Frequently Asked Questions

What differentiates lossless from lossy compression?
Lossless reduces size by removing redundancies without data loss, as in ZIP or PNG, for exact recovery. Lossy discards imperceptible elements, like in JPEG or MP3, for greater savings but lower fidelity. Grade 10 students test both on files to see sizes drop 20-50% lossless, up to 90% lossy, with quality assessments guiding understanding.
How can active learning help students grasp data compression?
Active methods like compressing personal files, measuring sizes, and rating quality make trade-offs visible and audible. Pairs or groups debate applications, such as archiving versus streaming, fostering justification skills. Tools like 7-Zip reveal ratios instantly; class shares prevent isolated errors and connect theory to practice, boosting retention by 30-40% per studies.
What trade-offs exist in compression techniques?
Key trade-offs pit file size against quality and processing time. Lossless offers perfect fidelity but modest reductions; lossy shrinks more yet risks artifacts. Students analyze by compressing images at 50% versus 90% quality, noting storage gains versus visible blurring, and compute ratios to weigh decisions for bandwidth-limited scenarios.
Which compression suits different data types?
Text and code favor lossless like GZIP for integrity. Images use JPEG lossy for web speed, PNG lossless for graphics. Audio leans MP3 lossy; video H.264 lossy. Labs testing types show text compresses 60% lossless, images 80% lossy, helping students justify per Ontario standards through metrics and visuals.