Project brief · after lesson 2: Lossy or lossless
A club wants to share a lot of files without using up its storage or its internet. Your job is to find out what compression really does, and to say when it is safe to use.
Take one image and one text document your teacher approves. Save each in at least two ways, one that keeps everything and one that throws some away. Compare the file sizes and look closely at what changed. Then compress a short row of pixels by hand using run-length encoding, and have a partner rebuild it.
Steps along the way
Tick each one when it is done.
- You have saved each file in at least two formats and recorded every size.
- You have looked at the results closely and written down what is different, or that nothing is.
- Your pixel row is encoded and your partner rebuilt it exactly.
- You can say which kind of compression suits each of your files and give a reason.
Hand in
- A table of file sizes: each file, each format, and its size, with a note on which formats keep everything and which do not.
- Close-up pictures or a description of what changed in the image when information was thrown away.
- A row of at least 20 pixels you designed, its run-length encoding, and your partner's rebuilt row next to the original.
- A short explanation: one real reason file size matters, which of your files you would compress each way and why, and one thing that could go wrong if the wrong kind of compression were used.
Show that you can
Your work and your explanation should show each of these.
Why compression is needed
- Correctly explains what compression does (reduces file size)
- Gives at least one concrete reason why reducing file size matters
Lossless compression — run-length encoding
- Correctly applies RLE to encode a simple sequence
- Explains how the encoded form represents the original data
Lossy vs lossless — trade-offs and consequences
- Correctly distinguishes lossless (exact recovery) from lossy (permanent data loss) compression
- Identifies an appropriate context for each type and justifies the choice
- Names at least one consequence of using lossy compression in an inappropriate context
Make it yours
- Find a picture that run-length encoding would shrink a lot and one it would hardly shrink, and say why.
- Save the image at three quality levels and find where you first notice a difference.
- Write the encoding of a row that gets longer when you run-length encode it.