Main content
AP®︎/College Computer Science Principles
Course: AP®︎/College Computer Science Principles > Unit 1
Lesson 6: Lossless data compressionThe need for compression
Modern computers can store increasingly large numbers of files, but file size still matters. The smaller our files are, the more files we can store.
We use compression algorithms to reduce the amount of space needed to represent a file.
There are two types of compression: lossless and lossy.
Lossless compression algorithms reduce the size of files without losing any information in the file, which means that we can reconstruct the original data from the compressed file.
Lossy compression algorithms reduce the size of files by discarding the less important information in a file, which can significantly reduce file size but also affect file quality.
We'll first explore lossless compression techniques that work for text documents, simple images, and all binary data, and then explore lossy compression techniques for photos and audio.
Want to join the conversation?
- i loss (reference) my dad in a car accident(29 votes)
- This is considered a lossy compression because you loss unimportant values.(32 votes)
- In lossy compression what do you mean by discarding less important information? In an .JPEG or any image related file extension i could understand that those files when they're reduced they lose quality, but what about like documents?(6 votes)
- Lossy compression involves removing less important information and so this allows compression of files like audios, pictures or videos since the lost information might be unnoticeable but for documents, lossy compression cannot be used since it can lead to missing of some characters hence making the document unreadable so for documents only lossless compression works(26 votes)
- How on earth is this so confusing, yet understandable? To me its kinda a teeter-toter of I understand this, to I have no clue....(11 votes)
- I know right that's how I feel about all computer science. It paradoxically seems both easy and hard at the same time, which I guess is why it is so interesting.(2 votes)
- absolutely peachy(3 votes)
- what is your favorite candy?(7 votes)
- How can we reconstruct the original data? Why don't people just use lossless compression?(2 votes)
- Losslessly compressed files usually contain some sort of table that allows the original file to be reconstructed.
You usually won't notice the loss of quality in images and videos caused by lossy compression and lossy compression tends to give better compression ratios than lossless compression.(7 votes)
- This is very interesting 🤔🤔💭(5 votes)
- Zǎo shang hǎo zhōng guó!
Xiàn zài wǒ yǒu bing chilling
Wǒ hěn xǐ huān bing chilling
Dàn shì "sù dù yǔ jī qíng jiǔ" bǐ bing chilling
"sù dù yǔ jī qíng, sù dù yǔ jī qíng jiǔ"
Wǒ zuì xǐ huān
Suǒ yǐ xiàn zài shì yīn yuè shí jiān
Zhǔn bèi
Yī, èr, sān
Liǎng gè lǐ bài yǐ hòu
"Sù dù yǔ jī qíng jiǔ"
Liǎng gè lǐ bài yǐ hòu
"Sù dù yǔ jī qíng jiǔ"
Liǎng gè lǐ bài yǐ hòu
"Sù dù yǔ jī qíng jiǔ
Bù yào wàng jì, bù yào cuò guò
Jì dé qù diàn yǐng yuàn kàn "sù dù yǔ jī qíng jiǔ"
Yīn wéi fēi cháng hǎo diàn yǐng
Dòng zuò fēi cháng hǎo
Chà bù duō yī yàng bing chilling
Zài jiàn(5 votes) - how do you make information smaller and compress it even though theres a lot in lossless? how can it be made smaller with the same amount of info(2 votes)
- Lossless compression describes data in a different way that takes up less memory. For example, instead of explicitly stating the series of numbers "1, 4, 9, 16, 25, 36, 49, 64, 81, 100", we could say "x^2 for 0 < x < 11". The two descriptions are equivalent, but the second is smaller.(6 votes)
- do we have any videos for this? Reading on computer hinders my comprehending quality lol(4 votes)