An open API service indexing awesome lists of open source software.

https://github.com/swastikchauhan28/file-compression-system

A Java application for compressing and decompressing text files using Huffman Coding. Includes a GUI for easy file selection, compression, and decompression.
https://github.com/swastikchauhan28/file-compression-system

dsa-algorithm file-input-output huffman-compression-algorithm java swing swing-gui

Last synced: 7 months ago
JSON representation

A Java application for compressing and decompressing text files using Huffman Coding. Includes a GUI for easy file selection, compression, and decompression.

Awesome Lists containing this project

README

          

# ๐Ÿ“ฆ FileCompression-Project-DS

## ๐Ÿ“ Project Overview

This project is a desktop-based Java application that performs **Text File Compression and Decompression using Huffman Coding**. Huffman Coding is an efficient greedy algorithm that reduces file size by encoding frequently used characters with shorter binary codes.

The application allows you to:
- Compress text files and reduce their size.
- Decompress files back to their original form.
- Compress any alphabetic string directly into a binary sequence.

---

## ๐Ÿš€ How It Works

The app uses the **Huffman Tree** to assign binary codes to characters based on their frequency in the input. Characters that appear more frequently are assigned shorter codes, resulting in an overall reduced file size.

### โœ… Features
- ๐Ÿ“‚ **Select and Compress**: Browse and compress any text file.
- ๐Ÿ” **Decompress Files**: Restore previously compressed files.
- ๐Ÿงพ **String Compression**: Enter a string manually to get its Huffman-encoded binary.
- ๐Ÿ–ฅ๏ธ **User-Friendly GUI**: Simple and intuitive interface for all actions.
- ๐Ÿ’พ **Save Output**: Choose location to save compressed or decompressed files.

---

## ๐Ÿ› ๏ธ How to Run

### Option 1: Using Pre-Built Executables
1. Clone or download the repository.
2. Go to the `Executable/` folder.
3. Run:
- `EncoderGUI.jar` โ€“ Works on systems with Java installed.
- `Encoder.exe` โ€“ Windows executable, no Java required.

### Option 2: From Source Code
1. Open the project in any Java IDE like IntelliJ IDEA or Eclipse.
2. Locate the `EncoderGUI.java` file in the `src/` directory.
3. Run the `main()` method inside `EncoderGUI`.

---

## ๐Ÿงฑ Folder Structure

file-compression-system/ โ”œโ”€โ”€ Executable/ โ”‚ โ”œโ”€โ”€ EncoderGUI.jar โ”‚ โ””โ”€โ”€ Encoder.exe โ”œโ”€โ”€ src/ โ”‚ โ””โ”€โ”€ (All Java source files including EncoderGUI.java) โ”œโ”€โ”€ README.md โ””โ”€โ”€ ...

---

## ๐Ÿ’ป Technologies Used

- **Java** โ€“ Main programming language
- **Swing** โ€“ For building the GUI
- **File I/O** โ€“ For reading/writing input and output files
- **Huffman Coding Algorithm** โ€“ For compression logic

---

## โœ๏ธ Author

**Swastik Singh Chauhan**

---

## ๐Ÿ“œ License

This project is for academic use only. Feel free to explore and modify it as needed.

---