GithubHelp home page GithubHelp logo

lluiscamino / huffmanfilecompressor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 86 KB

Java compression application based on Huffman's coding

License: MIT License

Java 100.00%
compression compression-algorithm compression-application compressor huffman-coding huffman-coding-algorithm huffman-compression huffman-compression-algorithm huffman-decoder huffman-decoding

huffmanfilecompressor's Introduction

HuffmanFileCompressor

Build status Project license Open issues

Open source file compression and decompression program based on Huffman's coding.

Developed as a project for the Advanced Algorithms course at the University of the Balearic Islands.

Features

  • Works on all modern OS.
  • File compression and decompression.
  • Intuitive graphical user interface (GUI).
  • Visualization of Huffman trees.

How does it work

Compressor

The compressor or encoder first reads the input file and constructs a Huffman tree based on the frequency of each byte in the file. For example, for an input file with the sentence "AABBBCD", it would create the following tree:

Huffman tree example for sentence "AABBBCD"

Then, it encodes the input tree at the start of the output file, so that it can be decompressed in the future.

Finally, it builds a map between the input file bytes and their Huffman encoding and it writes the corresponding encoded bits into the output file. For example, the map for the input file with contents "AABBBCD" would be: {A=10, B=0, C=110, D=111}.

Decompressor

The decompressor or decoder first reads the compressed file and builds the Huffman tree from its encoded representation.

Then, it uses this tree while reading the compressed file to write the decompressed file.

How to use it

The program contains an intuitive graphical user interface that allows compressing and decompressing files easily.

To compress or decompress a file, just select it on the file selector and then click on one of the two buttons located at the right menu, as shown in the next screenshot.

Program GUI

After having compressed or decompressed a file, it is possible to see the Huffman tree and codes. The Huffman tree can also be saved as a SVG image.

huffmanfilecompressor's People

Contributors

lluiscamino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.