Compression
Why compress files?
Processing power and storage space is very valuable on a computer. To get the best out of both, it can mean that we need to reduce the file size of text, image and audio dataUnits of information. In computing there can be different data types, including integers, characters and Boolean. Data is often acted on by instructions. in order to transfer it more quickly and so that it takes up less storage space.
In addition, large files take a lot longer to downloadingTo copy a file from the internet onto your computer or device. or uploadTo add data to a server on the internet, eg you can upload videos to social media websites. which leads to web pages, songs and videos that take longer to load and play when using the internet.
compressionA method of reducing file sizes, particularly in digital media such as photos, audio and video. addresses these issues.
Any kind of data can be compressed. There are two main types of compression: lossy and lossless.
Lossy compression
Lossy compression removes some of a file’s original data in order to reduce the file size. This might mean reducing the numbers of colours in an image or reducing the number of samples in a sound file. This can result in a small loss of quality of an image or sound file.
A popular lossy compression method for images is JPEGJoint Photographic Experts Group - a digital image format which uses lossy compression., which is why most images on the internet are JPEG images. A popular lossy compression method for sounds is MP3A standard audio file format which uses lossy compression. Compatible with most media players. Designed by the Moving picture experts group - layer 3..
Once a file has been compressed using lossy compression, the discarded data cannot be retrieved again.
Lossless compression
Lossless compression doesn’t reduce the quality of the file at all. No data is lost, so lossless compression allows a file to be recreated exactly as it was when originally created.
There are various algorithms for doing this, usually by looking for patterns in the data that are repeated. zipA file format that takes an existing file or files and compresses them into a single file of a smaller size. files are an example of lossless compression.
The space savings of lossless compression are not as good as they are with lossy compression.