Skip to content

BojanaAri/Compression-Tool-with-Huffman-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Experimental project for coding up a compression tool using Huffman algorithm.

Huffman Compression and Decompression Tool

This project implements a file compression and decompression utility using Huffman Coding, a lossless data compression algorithm.

Huffman Algorithm

  • Huffman coding generates prefix codes, meaning no code is a prefix of another. This ensures that the encoded data can be uniquely decoded without ambiguity.
  • It produces the shortest possible average code length for a given set of symbols and their frequencies, making it optimal for compression.
  • Compression and decompression can be performed in linear time with respect to the input size, making it suitable for real-time applications.
  • Huffman coding can be adapted to different types of data by analyzing the frequency of symbols in the input.
  • The Huffman tree is built dynamically based on the input data, making it flexible and adaptable.

Features

  • Compression: Compresses a text file using Huffman encoding and saves the output as a binary file.
  • Decompression: Decompresses a binary file back into its original text format.
  • Command-Line Interface: Simple command-line interface for easy usage.

Usage

The tool is operated via the command line. Below are the available commands:

Compress a File

To compress a text file, use the -c option followed by the filename:

java Main.java -c "filename.txt"

Decompress a File

To decompress a text file, use the -d option followed by the filename:

java Main.java -d "filename.txt"

TO-DO

  • Compression / Decompression of Images
  • GUI interface; not command-line

About

Experimental project for coding up a compression tool using Huffman algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages