Skip to content

johnjg75dev/Compresso-Lab

Repository files navigation

Compresso Lab: Data Compression Research & Design Workbench

Compresso Lab is a web-based interactive tool for experimenting with and learning about data compression algorithms. It provides a hands-on environment to build, test, and analyze compression pipelines, with AI-powered insights and optimization suggestions.

Features

  • Interactive Pipelines: Build compression pipelines by chaining multiple algorithms together.
  • Real-time Analysis: Instantly see the results of your compression pipeline, including size, ratio, and entropy changes.
  • Data Visualization: Analyze your data with byte-level heatmaps, frequency charts, and data composition bars.
  • AI-Powered Insights:
    • Analysis: Get an AI-generated analysis of your compression pipeline's effectiveness.
    • Optimization: Let the AI suggest an optimal compression pipeline for your data.
    • Brute Force Search: Automatically search for the best combination of algorithms.
  • Multiple Algorithms: Experiment with a variety of classic compression and transformation algorithms.
  • Save & Load: Save your entire workspace, including pipelines and custom data presets, to a file and load it back later.
  • Side-by-Side Comparison: Compare the performance of up to four different pipelines at once.

Tech Stack

  • Frontend: React with Vite
  • Language: TypeScript
  • AI: Google Gemini (via @google/genai)
  • Charting: Recharts
  • Styling: Tailwind CSS

Getting Started

Prerequisites

  • Node.js and npm
  • A Google AI API key (for AI features)

Installation & Running

  1. Clone the repository:

    git clone https://github.com/johnjg75dev/Compresso-Lab.git
    cd Compresso-Lab
  2. Install dependencies:

    npm install
  3. Set up your API key:

    • Create a .env.local file in the root of the project.
    • Add your Google AI API key to the file:
      API_KEY=your_api_key_here
      
  4. Run the development server:

    npm run dev
  5. Open your browser: Navigate to http://localhost:5173 (or the address shown in your terminal).

Compression Algorithms

The following algorithms are available in Compresso Lab:

Lossless Compression

  • RLE (Run-Length Encoding): Simple compression for data with repeating values.
  • LZW (Lempel-Ziv-Welch): A dictionary-based compression algorithm.
  • Huffman Coding: Uses a frequency-sorted binary tree to assign codes to characters.
  • Arithmetic Coding: Encodes an entire message into a single number.

Transformations

  • BWT (Burrows-Wheeler Transform): Permutes the data to group similar characters together, making it easier to compress.
  • MTF (Move-to-Front): A data transformation algorithm that often improves the performance of subsequent compression.
  • Delta Encoding: Stores the difference between consecutive bytes.
  • XOR Transform: Applies a simple XOR operation with a given key.

Lossy Compression

  • DCT (Discrete Cosine Transform): A lossy compression technique often used in image and signal processing.

Miscellaneous

  • Base64: Encodes binary data into an ASCII string format.

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors