In this project, I have developed a File Compression and Decompression Tool. My tool allows users to compress and decompress files directly through a browser, simulating the behaviour of OS-level file compression utilities.
WEB APP LINK Live Demo: https://file-compressor-project-two.vercel.app/
OBJECTIVE
The primary objective of this project is to: • Understand the working of common file compression algorithms. • Demonstrate how lossless compression techniques can reduce file size without data loss. • Apply Operating System concepts (like file handling and memory optimization) in a user-friendly web environment.
PROJECT OVERVIEW
My File Compressor Web App enables users to: • Upload any file from their system. • Compress the file using efficient lossless algorithms. • Download the compressed file. • Decompress previously compressed files and retrieve the original content.
The web app consists of two main sections:
- File Compression Page: For uploading, compressing, and downloading files.
- About Page: Describing the algorithms used and providing student details.
COMPRESSION ALGORITHMS USED
LZ77 (Lempel–Ziv 1977)
A dictionary-based lossless compression algorithm that replaces repeating sequences of data with pointers to earlier occurrences within a sliding window. It reduces redundancy effectively. Huffman Coding An entropy-based technique that assigns shorter binary codes to frequent symbols, minimizing total storage size. It’s widely used in formats like JPEG and MP3. ZIP (Combination of LZ77 + Huffman) A hybrid method combining pattern replacement (LZ77) with efficient encoding (Huffman Coding) to achieve high compression ratios. Used in formats like .zip, .png, and .gzip.
WORKING PRINCIPLE
- The user uploads a file via the browser.
- The algorithm reads and compresses it using JavaScript implementations of LZ77 and Huffman Coding.
- The compressed data is then made available for download.
- In decompression mode, the reverse process restores the original file without any data loss.
WORKING EXAMPLE:
- Compression
- Decompression
