Lossless encoding or lossless compression refers to the process of encoding data more efficiently so that it occupies fewer bits or bytes, but when the data is compressed, the original data can be re-bited.

The advantage of lossless encoding techniques is that they produce an exact copy of the original data, but they also have some disadvantages compared to lossy encoding techniques.

Lossless coding techniques cannot provide a high level of compression. Few lossless encoding techniques can achieve a compression ratio higher than 8:1, which compares negatively with lossy encoding techniques.


Lossless Compression Technique

  • Run Length Encoding (RLE) - This technique reduces the frequency of repeating symbols in a string by using a special marker at the beginning of the symbol.
  • Lempel-Ziv-Welch (LZW) - This technique also works similarly to the RLE technique and searches for duplicate strings or words and stores them in variables. It then uses a pointer in place of the string, and the pointer points to the variable where the string is stored.
  • Huffman Coding - This technique handles data compression of ASCII characters. After calculating the probability of each symbol, it creates a complete binary tree for the various symbols and places them in descending order.