Loading...
Hello, my name is Mr. Hogan.
I'm so excited to be learning with you today.
We are going to have such a great time learning about data representation of images and sounds.
I'll be supporting you with our learning during these lessons.
I'm pleased that you've decided to learn about file size and compression.
We are going to do brilliantly.
Welcome to today's lesson from the unit Data Representation: Images and Sound.
This lesson is called File Size and Compression.
The outcome of the lesson is I can explore what compression is and the impact it can have on the size and quality of a file.
I'm really looking forward to this lesson.
I hope you are, too.
We've got two key words.
So, we'll be referring to these throughout the lesson so you don't need to understand them fully now.
The first one is lossy compression.
This is a method where data is permanently lost during the compression process and must be approximated when the file is decompressed.
The second keyword is lossless compression.
This is a method of compression where no data is permanently lost during the process.
Remember, you can come back to this keyword slide at any time when we use these words in the actual lesson content.
This is the lesson outline.
It is split into three.
The first part is explain why it's useful to compress files.
Secondly, compare lossy and lossless compression.
And then the third and final part is evaluate the benefits and drawbacks of compression.
Let's move on to the first part of the lesson, explain why it's useful to compress files.
Laura is asking, "My phone is almost out of space! I have all these videos and images taking up too much room." Alex replies, "The more bits files use, the more space you need to store them." Sequences of bits representing image and sound can become extremely long.
More bits require more space to store them and more time to transfer.
Any process that reduces the size of a representation is called compression.
Let's have a quick check.
What does compression mean in the context of digital data like images and sound? Is it A, making the data take up more storage space? B, reducing the size of data while keeping the important information? Or C, making the data easier to understand while deleting the most important information? You can pause the video at any time or go back to a previous slide.
So, the answer is B, reducing the size of data while keeping the important information.
So, that's what compression means in the context of digital data like images and sound.
When people send a text message, they sometimes miss out letters to make it shorter.
This is a message without any letters missing.
So, the message is, "It is great to see you tonight.
Thank you for your present." This is the same message with letters missing.
"It is gr8 2 c u 2nite.
TY for your present." So, I can read that, but it's actually shortened a lot of the words by either taking letters out or replacing letters with numbers, or both, like "gr8" is great, and tonight is the number 2 with N-I-T-E, not the full spelling of night.
That is 59 characters used on the left-hand side, the full message, compared to 43.
So, fewer characters mean fewer bits are used.
Compression makes file sizes smaller.
Compressing files is useful because it reduces the amount of storage space needed, allowing you to save more files on a device.
Additionally, it speeds up file transfer times, as smaller files take less time to upload or download.
A compression technique is a set of steps, known as an algorithm, used to make files smaller.
This algorithm reduces the number of binary digits, resulting in fewer bits.
So, on the left-hand side you can see the original file with lots of bits.
The compression algorithm happens and executes and it processes it into a compressed file, which uses fewer bits.
A decompression algorithm is a process that undoes the steps of compression, bringing the file back to its original size.
It increases the number of binary digits, adding back the bits that were removed during compression to recreate the original data as accurately as possible.
So, you can see the compressed file on the left-hand side with fewer bits.
Then the decompression algorithm is in the middle, which processes it into the file that can be accessed, viewed, or played.
Let's have a quick check.
Which of these is a benefit of compressing files? Is it A, compressed files are quicker to transfer over the internet? Is it B, compressed files always use more storage space? Or is it C, compressed files can only be opened on special computers? Have a think about it.
Remember, you can rewind the video at any time or pause it.
The answer is A, compressed files are quicker to transfer over the internet.
Well done.
Compression may change the data within the file but does not change the fundamental properties of the file itself.
A bitmap image that is compressed will still have the same resolution as it did before it was compressed.
A 10-minute piece of music will still last for 10 minutes.
Normally, users don't actively choose to compress or decompress a file.
If the file format happens to be compressed, the process of compressing and decompressing is automatic.
For example, when you stream a movie online, the video file is decompressed automatically so your device can play it.
The camera on your smartphone is probably set to save images in a compressed JPEG format.
Software on your phone would automatically apply the compression algorithm to any photos you take.
Let's have a practise.
One, why is file compression beneficial? Provide one reason related to storage efficiency and one related to transfer speed.
Two, give an example of when a file might be compressed automatically and an example of when a file might be decompressed automatically.
Three, explain the difference between a compression algorithm and a decompression algorithm.
Remember, you can pause the video at any time or rewind this video to refresh your memory about the questions.
Let's have a look at some sample answers for feedback.
Question one, why is file compression beneficial? Provide one reason related to storage efficiency and one related to transfer speed.
So, the sample answer is, the storage one, compressed files take up less storage space, so you can store more files on your computer or digital device.
And the one relating to speed, compressed files are quicker to transfer, upload and download, which saves time, and can be helpful if you have a slow internet connection.
The answer for question two, which was, give an example of when a file might be compressed automatically and an example of a file might be decompressed automatically.
So, for the compressed one, when you take a photo with your phone, it's usually saved as a JPEG file, which is a compressed image format.
This happens automatically to save storage.
The decompress one, when you stream a movie online, the video file is decompressed automatically so your device can play it.
Well done, and hopefully you've got most of this correct.
You've done really well to get this far.
Let's have a look at the sample answer for three.
Explain the difference between a compression algorithm and a decompression algorithm.
A compression algorithm is a set of instructions that makes a file smaller by removing unnecessary data.
A decompression algorithm is a set of instructions that reverses the compression, making the file its original size again.
Well done.
You've got this far in the lesson.
And hopefully you've enjoyed it so far.
So, we're going to move on to the second part of the lesson, which is where we are going to compare lossy and lossless compression.
Lossy compression describes compression techniques that always result in a loss of data.
When the file is decompressed, the data that was removed in the compression process is recreated from the data that remains in the file.
The recreated data will never be an exact copy of the original.
So, we can see the file on the left, represented as binary numbers, going through the lossy compression algorithm.
So, there we have a smaller file size as a compressed file, and then it goes through the decompression algorithm and it's slightly larger than the compressed file but never the exact copy of the original file.
And you can see that by the number of binary numbers.
It's more than the compressed file, but it's less than the original file.
Lossy compression is commonly used for image and sound files.
Data can be lost without noticeably affecting quality, as seen with MP3 audio files and JPEG images.
The subtle changes made by the compression algorithm to the original file are usually undetectable by the human eye and ear.
A check here now.
Which of the following is true about lossy compression? Is it A, it can reduce file size significantly, data is not lost and can be perfectly recovered? Is it B, it can reduce file size significantly, but some data is lost and cannot be perfectly recovered? Or is it C, it is only used for text files and documents? You can pause the video at any time or rewind it.
The answer is B, it can reduce file size significantly, but some data is lost and cannot be perfectly recovered.
Well done.
I hope you got that right.
But don't worry if your didn't, we will move on to the next part of the lesson.
And the next part is lossless compression.
This refers to techniques where no data is lost in the compression process.
When the file is decompressed, the contents are identical to the original file before it was compressed.
So you can see the original file on the left goes through the lossless compression algorithm, and then the compressed file is smaller in file size, which then goes through the decompression algorithm and restores it to the original file, identical to the original file.
Lossy compression typically results in smaller file sizes than lossless compression.
But lossless compression is better when the compressed data needs to be fully restored to its original form without any loss of data.
For example, legal digital documents that contain text and numbers where every character or number needs to be kept, or medical digital images where every detail is critical for a diagnosis.
Time for a quick check.
What is the main advantage of using lossless compression for important files? Is it A, some data is lost during the compression process? B, it guarantees that no data is lost during the compression process? Or is it C, it makes the files larger so they take up more space? Remember, you can have a think about the answer.
Pause the video at any time or rewind it.
The answer is B, it guarantees that no data is lost during the compression process.
Well done.
Time for a practise.
So, there's four questions.
Question one, explain the difference between lossy compression and lossless compression.
Two, give two examples of file types that commonly use lossy compression.
Three, why might someone choose to use lossy compression even though it means losing some data? Four, describe two scenarios where it would be important to use lossless compression.
Remember, you can pause the video at any time or rewind it.
So, some sample answers for feedback.
So, question one was explain the difference between lossy compression and lossless compression.
So the answer could be, some data is lost during lossy compression, and the decompressed file is not identical to the original.
No data is lost during lossless compression, and the decompressed file is exactly the same size as the original.
And for question two, which was give two examples of file types that commonly use lossy compression, so the sample answer here is MP3 for audio files and JPEG for image files.
Moving on to question three, why might someone choose to use lossy compression even though it means losing some data? So this sample answer is, someone might choose to use lossy compression because it reduces the file size more than lossless compression, making the file easier to store and quicker to transmit.
Despite some data loss, the reduction in size often has minimal impact on perceived quality, making it a practical choice for media like music and images where a perfect copy isn't necessary.
I hope you got this answer right.
Well done having a go.
Maybe you picked up on some points and not others, but well done for making it this far.
Question four, describe two scenarios where it would be important to use lossless compression.
So in this answer, it's important to keep every detail in legal documents, so lossless compression is used to ensure nothing is lost.
Medical images need to be very accurate for diagnosis, so lossless compression is used to preserve all the details.
Well done.
That's the end of the feedback.
We're going to move on to the final part of this lesson, which is evaluate the benefits and drawbacks of compression.
Laura is asking, "Why do we need to learn about compression if file types like MP3 or JPEG do it for us automatically?" Good question.
Alex is replying, "Good point! I guess I don't really think about it since it just happens when I save or send stuff like photos and music." Alex also continues, "But it's important to know the benefits and drawbacks.
For example, knowing how compression affects quality helps you choose the right file type for what you need." Laura replies, "Ah, so understanding it helps me decide when I want smaller file sizes, like for sharing, and when I need higher quality, like for editing." Yeah, Laura is quite right.
So, it's important to know how compression works because you need to decide what you're going to save the files as, and if you want to share them or you want higher quality when you're editing them.
So, here's a table.
We have benefits of compression and then an example associated with it.
So, a benefit is smaller file sizes.
So, it reduces file sizes, making them easier to store and share.
The example is compressed files are faster to transfer via messaging apps when you send a message on your phone.
Another benefit is its efficient use of storage.
It allows more files to be stored in the same amount of space.
An example of this is you can fit hundreds of MP3 songs in the same amount of storage as a few WAV files.
Another benefit of compression is faster transmission.
Smaller files download and upload more quickly, crucial for streaming and sharing.
An example of this is streaming services use compression to deliver smooth and quick playback.
There's also drawbacks of compression and examples.
So, the first drawback is loss of audio quality, lossy compression.
Lossy formats remove data, reducing quality.
A highly compressed MP3 may sound distorted or less clear.
Another drawback, limited editing flexibility.
Editing compressed files can lower the quality further.
So, an example of this is editing and re-saving an MP3 lots of times can introduce noise and make it sound a bit distorted.
Another drawback is compatibility issues.
Some older or professional audio equipment may not support certain compressed formats.
An example of this is professional studios require lossless formats like WAV for high-quality editing.
Time for a check.
Which is a potential drawback of using compression for audio files? Is it A, the files might become impossible to edit? Is it B, the sound quality might be reduced? Or is it C, the files might become too large to share easily? Have a think about the answer.
Remember, you can pause or rewind the video.
The answer is B, the sound quality might be reduced.
There's another check now.
Which is a characteristic of lossy compression but not lossless compression? Is it A, it reduces the file size? B, it can affect the quality of the data? Or C, it is used for images and audio? The answer is B, it can affect the quality of the data.
Practise time.
So, we have two questions here.
What is a drawback of using lossy compression? Give an example of a situation where lossy compression might be a good choice despite this drawback.
Two, what is an advantage of using lossless compression? Give an example of a situation where lossless compression would be important.
Remember, you can pause the video at any time, or skip back a few slides to see if you can find the answer.
Three, a museum curator is working with a large collection of historical documents and images.
They need to store these files digitally but also want to preserve their quality for future generations.
What factors should the curator consider when choosing between lossy and lossless compression for these files? Remember, pause the video at any time.
This is a slightly longer answer than the previous questions.
And remember, you can rewind the video as well.
So, some sample answers for feedback.
Question one, what is a drawback of using lossy compression? Give an example of a situation where lossy compression might be a good choice despite this drawback.
So, this is the sample answer.
A drawback of using lossy compression is that it permanently removes some data, which can lead to a reduction in quality.
An example where lossy compression might be a good choice is when streaming music online.
Even though the audio quality might be slightly lower, the smaller file size allows for faster streaming and less data usage, making it convenient for listening on mobile devices.
Feedback for question two, which was, what is an advantage of using lossless compression? Give an example of a situation where lossless compression would be important.
So, this sample answer is, an advantage of using lossless compression is that it preserves all the original data, meaning there is no loss in quality.
An example where lossless compression is important is in medical imaging, such as MRI scans.
In this case, maintaining the exact quality and details of the image is crucial for accurate diagnosis and treatment.
And question three, what factors should the curator consider when choosing between lossy and lossless compression for these files? So, this sample answer is, the curator should prioritise lossless compression for the historical documents and images to preserve all the details.
However, they need to consider their storage space, as lossless files can be quite large.
If space is limited, they might use lossy compression for some files, especially those shared online or used for education.
The type of file also matters.
Text documents and images need lossless compression, while audio recordings might be okay with lossy compression.
That's a long answer.
Hopefully you've got some of those points, if not all of them.
So, well done.
So, it's the end of the lesson.
You've done so well.
I've really enjoyed it.
In summary then, compression reduces the size of the digital files, making them easier to store and share.
Lossy compression significantly shrinks files by removing some data, while lossless compression keeps all data intact.
Compressed files have benefits like faster transfer speeds but can have drawbacks such as reduced quality or compatibility issues.
Well done.
You've done so well.
I hope you've really enjoyed it.
I know I have.