Skip to content

hopsoffice/ssim-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SSIM Calculator

A command-line tool to calculate the Structural Similarity Index (SSIM) between two PNG images.

Installation

  1. Create a virtual environment:
python -m venv .venv
  1. Activate the virtual environment:
# On Linux/macOS
source .venv/bin/activate

# On Windows
.venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

Calculate SSIM between two PNG images:

python run.py image1.png image2.png

Example

python run.py photo1.png photo2.png

Output:

SSIM Index: 0.8542

Features

  • Automatically trims images by removing background color (based on top-left pixel)
  • Converts images to grayscale for comparison
  • Resizes images to the same dimensions for accurate comparison
  • Returns SSIM index value between -1 and 1 (higher values indicate greater similarity)

About

A command-line tool to calculate the Structural Similarity Index (SSIM) between two PNG images.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages