can someone explain to me what exactly lossless compression does
im confused at the part where it supposedly reconstructs the file using compression but still manages to have a smaller file size. Isnt that loss of data????
- CantraLv 71 year agoFavourite answer
Lossy compression genuinely loses data in that it will disregard things and not include them in the compressed version. They are approximations and averages used to represent the original content. The uncompressed file cannot be reconstructed from this as data has been changed or is missing.
Lossless compression does not do this, the original uncompressed file can be perfectly reconstructed from the compressed version. While the compressed file has technically 'lost' data, the way the compression works is that it looks for redundancies and changes sections of data to pointers that reference an earlier section of data. To grossly oversimplify, if the data is 'I am what I am', then because 'I' and 'am' are duplicated, the compressed file could replace that data with a pointer to the original 'I' and 'am'. So the compressed file is slightly smaller, but the full original can be recreated from it. Ultimately nothing is 'lost'.
- Michal SychraLv 71 year ago
Some older programs did replacing the sequences of spaces by TAB statements. It was loosless, too.
- John RLv 71 year ago
computer data consists of ones and zeros. Compression works two ways - first it eliminates repetition.
if there is a section of the data that consists of a 1000 zeros in a row, instead of writing 0 1000 times, compression software just includes the instruction to "put 1000 zeros in this spot"
The next thing is does is to use a library of shorter segments to replace commonly used longer segments. The English equivalent is to use abbreviations, much like typing Mr. for Mister or Apt. for apartment, but on a larger scale.
Not all data compresses well. Some file types use built in compression. For example, bitmaps - .bmp files compress a great deal because they contain a lot of repetitious data. .JPG files have compression included in the file format, so if you attempt to compress them further you gain little. In fact, if you zip a .jpg the file may actually increase in size.