A lightweight and efficient file compression tool that utilizes Huffman Coding, a lossless data compression algorithm, to reduce the size of files. This project implements both compression and decompression functionality, making it easy to compress files and retrieve the original data seamlessly.
Features
- Efficient Compression**: Reduces file sizes using the Huffman Coding algorithm.
- Lossless Compression**: Ensures that no data is lost during compression.
- Custom File Support**: Supports various file types (e.g., text, binary).
- Easy-to-Use Interface**: Simple command-line interface for compression and decompression.
How It Works
Huffman Coding is a method of lossless data compression that assigns variable-length codes to input characters, with shorter codes assigned to more frequent characters.
Steps:
- Analyze the frequency of characters in the input file.
- Construct a Huffman Tree based on character frequencies.
- Generate Huffman Codes from the tree.
- Replace characters in the input file with their corresponding Huffman Codes to create the compressed file.
- To decompress, the process is reversed using the Huffman Tree.
Prerequisites
- Python 3.x