This project aims to provide an implementation of various data compression techniques in Python.
The following compression techniques are implemented in this project:
- LZ77 Compression
- LZ78 Compression
- LZW Compression
- Huffman Encoding
- Adaptive Huffman Encoding
- Modified Huffman Encoding
- Binary Arithmetic Coding
- Floating Arithmetic Coding
- Vector Quantization
To use this project, you will need Python 3 installed on your system. You can download Python 3 from the official website: https://www.python.org/downloads/
Once you have Python 3 installed, you can use the algorithms.
The project is divided into multiple modules, one for each compression technique. You can use these modules to compress and decompress data.
Here is an example of how to use the LZ77 module to compress a string:
from lz77 import lz77_compress, lz77_decompress
text = "ABAABABAABBBBBBBBBBBBA"
window_size = 6
lookahead_buffer_size = 4
compressed_data = lz77_compress(text, window_size, lookahead_buffer_size)
print(compressed_data)
#output : <0, 0, 'A'> , <0, 0, 'B'> , <2, 1, 'A'> , <3, 2, 'B'> , <5, 3, 'B'> , <2, 2, 'B'> , <4, 4, 'B'> , <2, 2, 'A'>
original_text = lz77_decompress(compressed_data)
print(original_text)
#output : ABAABABAABBBBBBBBBBBBA
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
๐ค Michael Maher
- Twitter: @Michael___Maher
- Github: @Michael-M-aher
Please โญ๏ธ this repository if this project helped you!
Copyright ยฉ 2022 Michael Maher.
This project is MIT licensed.