Implementation and Comparison of image compression algorithms
This project includes a Streamlit dashboard for interactive compression algorithm comparison!
# 1. Navigate to project root
cd Image_Compression_Algorithms
# 2. Activate virtual environment
.\venv\Scripts\Activate.ps1
# 3. Install dashboard dependencies (one-time)
pip install streamlit pandas
# 4. Launch dashboard
cd dashboard
streamlit run app.pyThe dashboard will open automatically in your browser at http://localhost:8501
- 📁 Multi-image upload - PNG, JPG, TIFF formats supported
- 🔄 Real-time compression - All 5 algorithms (Huffman, LZW, RLE, DCT, DFT)
- 📊 Metrics with lossless detection - Automatic PSNR=∞, SSIM=1.0 for perfect reconstruction
- 🖼️ Visual comparison - Side-by-side original vs compressed images
- 📈 Trade-off analysis - Interactive plots (CR vs PSNR, CR vs SSIM)
- 💾 Export capabilities - CSV download, JSON session save
- Upload images from
samples/kodak/(e.g.,kodim01.png) - Select algorithms: ✅ Huffman (lossless), ✅ DCT (lossy)
- Adjust parameters: Huffman base=2, DCT threshold=90%
- Click "
▶️ Run Compression" - View results and metrics
Expected Results (kodim01.png):
- Huffman: 8:1 compression, PSNR=∞, SSIM=1.0 (lossless)
- DCT: 1.1:1 compression, ~32 dB PSNR, ~0.85 SSIM (lossy)
📖 Full documentation: See dashboard/README.md and dashboard/QUICKSTART.md
This repository has been successfully converted from Jupyter notebooks to a structured Python project while preserving all original algorithm implementations verbatim.
-
image_compression_project/- Main Python package with:original_algorithms/- Verbatim algorithm implementations from notebookswrappers/- Thin CLI wrappers for easy command-line accesstests/- Comprehensive verification and unit tests- Full documentation and setup files
-
repo_backup_before_conversion/- Complete backup of original files -
Original notebooks preserved in
lossless/directory -
Documentation files:
conversion_log.txt,results_check.txt,cleanup_log.txt
# Navigate to the package
cd image_compression_project
# Install dependencies
pip install -r requirements.txt
# Run verification tests
python tests/verify_basic.py
# See detailed documentation
cat README.mdAll tests PASSED ✓
- 6/6 basic algorithm tests passed
- Lossless algorithms: Bit-exact reconstruction verified
- Original code preserved without modifications
- Wrapper equivalence confirmed
- Project README - Complete usage guide
- Conversion Log - Detailed conversion process
- Verification Results - Test results and quality metrics
- Cleanup Log - File preservation record