File Compression 101
Posted by: ipp in Other, tags: 101, comprsesion, computer, learn, techBasically file compression just looks for repeated things and instead of listing them out as repeats it puts a marker which refers back to the previous(same) item. Instead of using XX bytes to say there is a word it uses x bytes.
Example using the above 2 sentences ^
Instead: 2 times
Of: 2 times
It: 2 times
To: 2 times
Bytes: 2 times
There are 190 total characters(without spaces) in that example. If you take out the repeats(leave 1 for the reference and leave 1 character for the marker that is 13 characters you eliminated. Which makes it ~15% smaller. That was a very basic algorithm, the ones in zip,rar,etc are much more complex. This has been a detail of loseless file compression, basically that just means you can recreate the original file exactly how it was before.
However pictures, movies, sounds,etc are not as redundant as text and does not repeat much if at all, therefore it is very hard to compress them without permanently losing quality. Many of these are compressed using something as lossy compression, which means the original file cannot be recreated because you completely changed parts of the file. A great example of this in an image file is the sky, the sky is many different shades of blue however if you wanted to shrink the size of an image one of the first things a compression engine would do to the photo is change the many shades of blue into just a few.
Entries (RSS)