architectural drawings) can also give fair compression ratios. Take this short piece of text for example: The LZ77 algorithm would look at this text, realize that it repeats “howtogeek” three times, and change it to this: Then, when it wants to read the text back, it would replace every instance of (h) with “howtogeek,” bringing us back to the original phrase. The theoretical basis for compression is provided by information theory and, more specifically, algorithmic information theory for lossless compression and rate–distortion theory for lossy compression. Most of the files on your hard drive, however, are probably already in a compressed state. We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. Compression is one of those studio processes that is all too often taken for granted and not used to its full potential. These two algorithms are “LZ77” and “Huffman coding.” Huffman coding is quite complicated, and we won’t be going into detail on that one here. It was true when our hard drives were tiny, and the advent of the internet has just made it more critical. Other topics associated with compression include coding theory and statistical inference. This LZ77 algorithm applies to all binary data, by the way, and not just text, though text generally is easier to compress due to how many repeated words most languages use. This demo does work better with actual video, so if you want to check it out for yourself, you can download the same bitrate test videos used here. This algorithm is widely spread in our current systems since, for instance, ZIP and GZIP are based on LZ77. This is a screenshot I took that has not been compressed at all. BSc @ UC3M. Why are my digital photograph files so huge while photos on other Web sites are much smaller? How LZ77 Data Compression Works by@dbudhrani. MP3 also uses bitrate, ranging from the low end of 48 and 96 kbps (the low end) to 128 and 240kbps (pretty good) to 320kbps (high-end audio), and you will likely only hear the difference with exceptionally good headphones (and ears). Join 350,000 subscribers and get a daily digest of news, geek trivia, and our feature articles. This is what leads to those horrible-looking JPEGs that people have uploaded, shared, and screenshotted multiple times. Computer-generated color images (e.g. I then took that screenshot and ran it through Photoshop multiple times, each time exporting it as a low-quality JPEG. For example, text files can be smooshed down to become quite small. These can be text files if they contain lots of spaces for indenting but line-art images that contain large white or black areas are far more suitable. Computer-generated color images (e.g. Without it, videos would be hundreds of gigabytes, more than the average hard drive size in 2005 when YouTube launched. We call compression like this “lossless”—the data you put in is the same as the data you get out. So how does it save so much space? We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. How does file compression work? Well, this is only a worst-case scenario, exporting at 0% JPEG quality each time. This is mainly used for text and spreadsheets because losing words or data from a document isn't something you want to happen. You might not need to hear the creaking of the guitar pick on the string if the actual guitar is much, much louder. When a request is made by a browser for a page from your site your webserver returns the smaller compressed file if the browser indicates that it understands the compression. Windows Bitmap files (BMP) compress well. How-To Geek is where you turn when you want experts to explain technology. WAY more than is really needed to just export the info (for an example, try copying and pasting your text into a textbox cell, and look at the html info that comes out - I had a limit on a textbox size for a cms, and a 7 word sentence ballooned to 950 characters). File compression plays a big part in connecting us, letting us send less data down the line so we can have faster downloads and fit more connections onto busy networks. In this post we are going to explore LZ77, a lossless data-compression algorithm created by Lempel and Ziv in 1977. In this post we are going to explore LZ77, a lossless data-compression algorithm created by Lempel and Ziv in 1977. Now, this is an idealized example. If you’re interested in a more detailed explanation, this video from Computerphile is pretty helpful. You consent to our cookies if you continue to use our website. Testing compression Necessary when the source data is not plain text, say audio or video data. This is what the quality slider for JPEG in Photoshop and other image apps does—choose how many equations to use. How Does It Work? This is a zoomed frame taken from a video of a jellyfish. LZ77, on the other hand, is relatively simple and is what we’ll be talking about here. Instead, it stores images using something called a Discrete Cosine Transform, which is a collection of sine waves added together at varying intensities. To answer that question would involve explaining some very complicated math, certainly more than we can cover in this article, but you don’t need to understand precisely how it works mathematically to understand the basics. While all compression programs of this sort work with the same basic idea, there is actually a good deal of variation in the manner of execution. Compression Why compress files? Since we launched in 2006, our articles have been read more than 1 billion times. architectural drawings) can also give fair compression ratios. But lossy compression doesn't work so well for files where all the information is crucial. Therefore, they don’t benefit from additional compression. And the more you compress, the more data you lose.