Skip to content

CaptainOverride/HuffPressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—œ๏ธ HuffPressor

Advanced Huffman Compression Tool with a modern cyberpunk-themed UI.

Version Platform License C++ Qt


โœจ Features

  • ๐Ÿ—œ๏ธ File Compression - Compress text files using the Huffman coding algorithm
  • ๐Ÿ“ฆ Folder Archiving - Archive entire folders into .hpa files
  • ๐Ÿ”“ Decompression - Extract .hpf files and .hpa archives
  • โœ… Smart Validation - Automatic file type checking for each operation
  • ๐ŸŽจ Modern UI - Cyberpunk-themed interface with neon blue accents
  • ๐Ÿ–ฑ๏ธ Drag & Drop - Easy file selection via drag and drop
  • ๐Ÿ“Š Real-time Progress - Visual feedback during compression/decompression
  • ๐Ÿ’พ Custom Format - Efficient binary format for compressed data

๐Ÿ“ธ Screenshots

Home Page

Home Page

Compress File

Compress File

Compress File - Result

Compress File Result

Decompress File

Decompress File

Decompress File - Result

Decompress File Result


๐Ÿš€ Quick Start

Download (Windows)

  1. Go to Releases
  2. Download HuffPressor-v1.0.0-Windows.zip
  3. Extract and run HuffPressor.exe

Usage

  1. Launch the application
  2. Choose an operation:
    • ๐Ÿ“„ Compress File - Select a text file to compress
    • ๐Ÿ“‚ Compress Folder - Select a folder to archive
    • ๐Ÿ”“ Decompress File - Extract a .hpf file
    • ๐Ÿ“ฆ Decompress Folder - Extract a .hpa archive
  3. Select your file or folder (or drag & drop)
  4. Save the result!

๐Ÿ“ฆ Supported File Types

Compression

Text Files (where Huffman coding is most effective):

  • .txt, .md, .cpp, .h, .c, .hpp
  • .py, .java, .js, .ts
  • .html, .css, .json, .xml
  • .log, .csv, .yaml, .yml
  • And more...

Folders: All folder types (text-heavy folders recommended)

Decompression

  • .hpf - HuffPressor File (compressed file)
  • .hpa - HuffPressor Archive (compressed folder)

Note: Binary files (images, videos, executables) are already compressed and won't benefit from Huffman coding.


๐Ÿ› ๏ธ Build from Source

Prerequisites

  • CMake 3.15 or higher
  • Qt 6.10.1 (Qt6 Widgets, Qt6 Core, Qt6 Gui)
  • C++20 compatible compiler
    • MinGW-W64 GCC 14.1.0 (Windows)
    • Or MSVC 2019+ (Windows)
    • Or GCC 10+ / Clang 10+ (Linux/macOS)
  • Git

Build Instructions

# Clone the repository
git clone https://github.com/CaptainOverride/HuffPressor.git
cd HuffPressor

# Create build directory
mkdir build
cd build

# Configure with CMake
cmake ..

# Build
cmake --build . --config Release

# Run
./HuffPressor.exe  # Windows

๐Ÿงฎ How It Works

HuffPressor uses the Huffman Coding algorithm, a lossless data compression technique that:

  1. Analyzes character frequency in the input
  2. Builds a binary tree with frequent characters having shorter codes
  3. Encodes the data using variable-length codes
  4. Stores the tree structure and encoded data in a custom binary format

This results in significant compression for text-based files where character frequencies vary.

File Format

.hpf (HuffPressor File):

  • Header with metadata
  • Huffman tree structure
  • Compressed bit stream
  • Original file size

.hpa (HuffPressor Archive):

  • Archive header
  • Compressed folder structure
  • Multiple compressed files
  • Metadata for reconstruction

๐ŸŽจ UI Design

The application features a cyberpunk-themed interface with:

  • Dark radial gradient background
  • Neon blue (#00e5ff) accents and glow effects
  • Glass-morphic panels
  • Smooth hover animations
  • Responsive 2x2 grid layout

๐Ÿ“ Technical Details

  • Language: C++20
  • Framework: Qt 6.10.1
  • Algorithm: Huffman Coding
  • Platform: Windows x64
  • Build System: CMake 3.15+
  • Compiler: MinGW-W64 GCC 14.1.0
  • Architecture: Multi-threaded (Qt Worker threads)

Project Structure

HuffPressor/
โ”œโ”€โ”€ .gitignore              # Git ignore rules
โ”œโ”€โ”€ .gitattributes          # Git attributes
โ”œโ”€โ”€ CMakeLists.txt          # Build configuration
โ”œโ”€โ”€ LICENSE                 # MIT License
โ”œโ”€โ”€ README.md               # This file
โ”‚
โ”œโ”€โ”€ include/                # Public header files
โ”‚   โ”œโ”€โ”€ archiver.h
โ”‚   โ”œโ”€โ”€ bitReader.h
โ”‚   โ”œโ”€โ”€ bitWriter.h
โ”‚   โ”œโ”€โ”€ compressor.h
โ”‚   โ”œโ”€โ”€ decompressor.h
โ”‚   โ”œโ”€โ”€ errors.h
โ”‚   โ”œโ”€โ”€ huffmanTree.h
โ”‚   โ””โ”€โ”€ utils.h
โ”‚
โ”œโ”€โ”€ src/                    # Source code
โ”‚   โ”œโ”€โ”€ cli/                # Command-line interface
โ”‚   โ”‚   โ””โ”€โ”€ main.cpp
โ”‚   โ”œโ”€โ”€ core/               # Core compression logic
โ”‚   โ”‚   โ”œโ”€โ”€ archiver.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ bitReader.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ bitWriter.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ compressor.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ decompressor.cpp
โ”‚   โ”‚   โ”œโ”€โ”€ huffmanTree.cpp
โ”‚   โ”‚   โ””โ”€โ”€ utils.cpp
โ”‚   โ””โ”€โ”€ gui/                # Qt GUI application
โ”‚       โ”œโ”€โ”€ main.cpp
โ”‚       โ”œโ”€โ”€ mainWindow.cpp
โ”‚       โ”œโ”€โ”€ mainWindow.h
โ”‚       โ”œโ”€โ”€ worker.cpp
โ”‚       โ””โ”€โ”€ worker.h
โ”‚
โ”œโ”€โ”€ resources/              # Application resources
โ”‚   โ”œโ”€โ”€ icon.ico           # Windows icon
โ”‚   โ”œโ”€โ”€ icon.png           # Application icon
โ”‚   โ”œโ”€โ”€ resources.qrc      # Qt resource file
โ”‚   โ””โ”€โ”€ windows_icon.rc    # Windows resource file
โ”‚
โ””โ”€โ”€ screenshots/            # Screenshots for README
    โ”œโ”€โ”€ home.png
    โ”œโ”€โ”€ compress-file.png
    โ”œโ”€โ”€ compress-file-result.png
    โ”œโ”€โ”€ decompress-file.png
    โ””โ”€โ”€ decompress-file-result.png

Note: The build/ directory is generated during compilation and is not tracked by Git.


๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! This is a personal project, but I'm open to improvements.

How to contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Before contributing:

  • Check existing issues to avoid duplicates
  • For major changes, open an issue first to discuss
  • Keep pull requests focused on a single feature/fix

Note: This is a personal project maintained in my free time. Response times may vary, but all contributions are appreciated!

๐Ÿ’ก Ideas for Contribution

  • Bug fixes and improvements
  • Better error handling
  • Performance optimizations
  • Documentation improvements
  • Cross-platform support (Linux, macOS)
  • Unit tests
  • Command-line interface

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ› Known Issues


๐Ÿ—บ๏ธ Roadmap

  • Command-line interface
  • Compression statistics dashboard
  • Batch file processing
  • Cross-platform support (Linux, macOS)
  • Compression ratio comparison
  • Custom compression profiles

๐Ÿ‘จโ€๐Ÿ’ป Author

CaptainOverride


๐Ÿ™ Acknowledgments

  • Engineered with Qt Framework
  • Huffman Coding algorithm by David A. Huffman (1952)
  • UI inspired by modern cyberpunk aesthetics

โญ Star History

If you find this project useful, please consider giving it a star! โญ


Engineered with โค๏ธ by CaptainOverride

Report Bug ยท Request Feature