Common compressed file formats and what they are used for

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Common compressed file formats and what they are used for

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which format is the better choice for a holiday photo you want to share online with a small file size?
A ZIP
B JPEG
2. Which format suits a school logo with sharp edges and flat colours?
A PNG
B JPEG
3. Which statement is true?
A PNG is lossless, so no image data is lost
B PNG is lossy, so some image data is lost
4. You want to save a screenshot of an error message with readable text. Which format should you pick?
A PNG
B MP3
5. Which file type is a lossy format for music?
A ZIP
B MP3

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1photo.jpg Asong.mp3
2report.zip BMP4 video is lossy, so the discarded data cannot be restored. Only lossless formats like ZIP or FLAC restore the original.
3A logo or screenshot with sharp edges and flat colours should be saved in a lossless format so it stays crisp CJPEG is lossy, not lossless. It can blur the sharp edges of a logo, so PNG is the better choice.
4Music for a phone is often saved in a lossy format so the song takes up far less storage Dschool_logo.png
5Save the school logo as JPEG because JPEG is lossless EA JPEG photo: lossy compression gives a much smaller file by dropping detail the eye barely notices
6movie.mp4 can be restored exactly to the original video FA ZIP archive: lossless compression that shrinks documents and can be unzipped to the exact original

Definitions

Compressed file format

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
photoFormat = "____" compression = "lossy"
2.
logoFormat = "___" compression = "lossless"
3.
musicFormat = "___" compression = "lossy"
4.
videoFormat = "MP4" compression = "_____"
5.
documentFormat = "___" compression = "lossless"

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A file = "beach.jpg"
B if file.endswith(".jpg"):
C print("Photo format")
D print("Lossless")
Question 2
A def best_for_logo()
B fmt = "PNG"
C print(fmt, "is lossless")
D best_for_logo()
Question 3
A music = song.mp3
B lossy = True
C if lossy:
D print("Smaller file")
Question 4
A docs = "essay.docx"
B method = "lossy"
C archive = "ZIP"
D print(archive, method)
Question 5
A video = "clip.mp4"
B lossy = True
C print("MP4 is lossless")
D print("Good for video")

Answer Key

Common compressed file formats and what they are used for
Section A: Quick Questions
Q1
B — JPEG
Q2
A — PNG
Q3
A — PNG is lossless, so no image data is lost
Q4
A — PNG
Q5
B — MP3
Section B: Match the Pairs
Q1
photo.jpg → A JPEG photo: lossy compression gives a much smaller file by dropping detail the eye barely notices
Q2
report.zip → A ZIP archive: lossless compression that shrinks documents and can be unzipped to the exact original
Q3
A logo or screenshot with sharp edges and flat colours should be saved in a lossless format so it stays crisp → school_logo.png
Q4
Music for a phone is often saved in a lossy format so the song takes up far less storage → song.mp3
Q5
Save the school logo as JPEG because JPEG is lossless → JPEG is lossy, not lossless. It can blur the sharp edges of a logo, so PNG is the better choice.
Q6
movie.mp4 can be restored exactly to the original video → MP4 video is lossy, so the discarded data cannot be restored. Only lossless formats like ZIP or FLAC restore the original.
Section C: Definitions
Q1
Compressed file format — A file type that stores data compressed: ZIP, PNG, FLAC are lossless; JPEG, MP3, MP4 are lossy. Each suits its content, such as photos, logos, music, video or documents.
Section D: Fill in the Blanks
Q1
photoFormat = "JPEG" compression = "lossy"
Q2
logoFormat = "PNG" compression = "lossless"
Q3
musicFormat = "MP3" compression = "lossy"
Q4
videoFormat = "MP4" compression = "lossy"
Q5
documentFormat = "ZIP" compression = "lossless"
Section E: Spot the Error
Q1
D — JPEG is a lossy format because it permanently throws away some detail to make photos smaller. Line 4 should print "Lossy".
Q2
A — A function definition must end with a colon. Line 1 should be def best_for_logo():
Q3
A — The file name is text, so it needs quotes. Without them Python treats song.mp3 as a variable. It should be music = "song.mp3".
Q4
B — ZIP is used for documents because it is lossless and every character must come back exactly. Line 2 should be method = "lossless".
Q5
C — MP4 video uses lossy compression to get small files that can be streamed. Line 3 should say MP4 is lossy.