Skip to content

Huffman Compression Algorithm Implementation on PGM photo format

License

Notifications You must be signed in to change notification settings

RamadanIbrahem98/huffmanCoding

Repository files navigation

Huffman Coding

license last-commit

This is an Implementation for the huffman coding algorithm for lossless compression. This implementation is done on PGM greyscale photo files with some examples in the data folder.

Table of contents

Running

To compile Project run the following command

g++ main.cpp huffman.cpp IOStream.cpp -o huffman

To Run the program for compression you should pass one argument (photo path) and you should have a folder in the pwd named encoded

./huffman ./directory/filename.pgm

To Run the program for decompression you should pass two arguments (frequency table and compressed file) and you shold have a folder in the pwd named decoded

./huffman ./encoded/filename.huf ./encoded/filename.frq

Using CMake

To compile project run the following commands

mkdir build
cd build
mkdir encoded decoded
cmake ..
make

To Run the program for compression you should pass one argument (photo path) and you should have a folder in the pwd named encoded

./huffman ../data/filename.pgm

To Run the program for decompression you should pass two arguments (frequency table and compressed file) and you shold have a folder in the pwd named decoded

./huffman ./encoded/filename.huf ./encoded/filename.frq

Status

  • The Console application is done.

About

This is part of the SBE201 course in the Systems and Biomedical Engineering Department - Cairo University
Dr.Ahmed Kandil
TA. Asem Alaa