Skip to content

AhmedFoda54/Data-Compression-Techniques

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Compression Techniques 💾

Java

A collection of various data compression techniques implemented in Java ☕. This repository explores both lossless and lossy compression algorithms.

📚 Table of Contents

About The Project

This project provides Java implementations for several fundamental data compression algorithms. It serves as a practical exploration of how different techniques reduce data size, comparing lossless methods (which allow perfect reconstruction) and lossy methods (which achieve higher compression at the cost of some data loss).

Techniques Implemented

Lossless Compression ↔️

These algorithms compress data without any loss of information. The original data can be perfectly reconstructed from the compressed data.

  • Standard Huffman Coding 🌳: A classic algorithm that assigns variable-length codes to input characters based on their frequencies.
  • Adaptive Huffman Coding 🌳🔄: An adaptive version of Huffman coding where the code tree is updated dynamically as the data is processed.
  • LZ Algorithm 🤐: Implementation of an LZ-family dictionary-based compression algorithm (e.g., LZ77/LZW). (Note: Specific variant might need confirmation from code)

Lossy Compression 📉⚠️

These algorithms achieve higher compression ratios by discarding some information deemed less critical. This is often used for images, audio, and video where perfect accuracy is not always required.

  • Differential Pulse Code Modulation (DPCM) 〰️: A signal coding technique that encodes the difference between consecutive samples rather than the samples themselves.
  • Trained Vector Quantization (VQ) 🔢🎯: A quantization technique that maps vectors of input data to a finite set of 'codebook' vectors, trained on representative data.

📁 Folder Structure

The repository is organized as follows:

|-- Lossless Compression/
    |-- Adaptive_Huffman/     # Implementation of Adaptive Huffman
    |-- LZ/                   # Implementation of LZ algorithm
    └── Standard Huffman/     # Implementation of Standard Huffman
|-- Lossy Compression/
    |-- DPCM/                 # Implementation of DPCM
        |-- src/
        |-- output/
        └── DPCM Report.pdf   # Report detailing the DPCM implementation
|-- Trained Vector Quantization/ # Implementation of Trained VQ
        |--src/
        └── Trained Vector Quantization Report.pdf # Report detailing the VQ implementation

🚀 Getting Started

The implementations are written in Java. To run the code:

  1. Clone the repository:

    git clone https://github.com/AhmedFoda54/Data-Compression-Techniques.git
    cd Data-Compression-Techniques
  2. Compile and Run: Navigate into the specific technique's directory (e.g., Lossless Compression/Standard Huffman/ ). Compile the Java source files and run the main class. You might need a Java Development Kit (JDK) installed. (Specific compilation/run commands might vary depending on the project setup within each folder - check the src directories for main classes).

    Example (conceptual):

    cd "Lossless Compression/Standard Huffman/src"
    javac *.java
    java MainClass # Replace MainClass with the actual main class name

📄 Reports

Detailed reports explaining the implementation and results for DPCM and Trained Vector Quantization are available within their respective folders:

  • Lossy Compression/DPCM/DPCM Report.pdf
  • Trained Vector Quantization/Trained Vector Quantization Report.pdf

Feel free to explore the code and learn more about these fascinating compression techniques! ✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages