A modular multimedia compression evaluation platform featuring side-by-side visual analysis and objective distortion metrics (PSNR, SSIM, MSE, BPP, and Compression Ratio).
The evaluation engine evaluates fidelity across three primary standards:
-
Peak Signal-to-Noise Ratio (PSNR): Logarithmic metric of maximum signal power relative to corrupting noise:
$$\text{PSNR} = 10 \cdot \log_{10} \left( \frac{\text{MAX}_I^2}{\text{MSE}} \right)$$ -
Structural Similarity Index (SSIM): Perceptual metric measuring luminance (
$l$ ), contrast ($c$ ), and structural correlation ($s$ ):$$\text{SSIM}(x, y) = [l(x, y)]^\alpha \cdot [c(x, y)]^\beta \cdot [s(x, y)]^\gamma$$ -
Bits Per Pixel (BPP): Information density of the encoded asset:
$$\text{BPP} = \frac{\text{Compressed Size (Bytes)} \times 8}{\text{Width} \times \text{Height}}$$
compary/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI workflow
├── samples/ # Sample test images
├── src/
│ ├── algorithms/ # Quantization & chroma subsampling routines
│ ├── gui/ # Interactive desktop comparison window
│ ├── metrics/
│ │ ├── compression_metrics.py # Size ratio & BPP calculations
│ │ └── quality_metrics.py # PSNR, SSIM, MSE implementations
│ └── main.py # Application entry point
├── tests/
│ └── test_metrics.py # Metrics verification test suite
├── requirements.txt
├── .gitignore
├── LICENSE
└── README.md
git clone https://github.com/luminariadev/compary.git
cd comparypython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt# Generate sample test patterns
python generate_samples.py
# Launch comparative desktop GUI
python run.pyExecute unit tests via pytest:
pytest tests/ -vCI workflows test metric accuracy automatically via GitHub Actions.
Distributed under the MIT License.