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.
- Host: GitHub
- URL: https://github.com/swastikchauhan28/file-compression-system
- Owner: swastikchauhan28
- Created: 2025-04-21T14:24:48.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-21T14:49:28.000Z (7 months ago)
- Last Synced: 2025-04-22T14:09:32.237Z (7 months ago)
- Topics: dsa-algorithm, file-input-output, huffman-compression-algorithm, java, swing, swing-gui
- Language: Java
- Homepage:
- Size: 1.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.
---