Skip to content

Structural similarity image comparison with compatibility to the python image library PIL.

License

Notifications You must be signed in to change notification settings

ChsHub/SSIM-PIL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me a Coffee at ko-fi.com

SSIM-PIL

Comparison of two images using the structural similarity algorithm (SSIM). The resulting value varies between 1.0 for identical images and 0.0 for completely different images. It's based on the PIL and also supports GPU acceleration via pyopencl.

Installation

python3 -m pip install SSIM-PIL

Be sure to install a working version of pyopencl to benefit from faster parallel execution on the GPU. (The code was tested with OpenCl version 1.2.)

Usage Example

from SSIM_PIL import compare_ssim
from PIL import Image

image1 = Image.open(path)
image2 = Image.open(path)

# Compare images using OpenCL by default
value = compare_ssim(image1, image2)
print(value)

#  Compare images using CPU-only version
value = compare_ssim(image1, image2, GPU=False)
print(value)

Feedback

For feedback please contact me over github: https://github.com/ChsHub/SSIM-PIL.

About

Structural similarity image comparison with compatibility to the python image library PIL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published