Comparison of two images using the structural similarity algorithm (SSIM).
Project description
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)
value = compare_ssim(image1, image2) # Compare images using OpenCL by default
print(value)
value = compare_ssim(image1, image2, GPU=False) # Compare images using CPU-only version
print(value)
Feedback
For feedback please contact me over github: https://github.com/ChsHub/SSIM-PIL.
Donate
If you like my projects, I would appreciate any donation. BTC: bc1qkam6e23x6v4spdc7w52mwq0nag204meps78y9m
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for SSIM_PIL-1.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5adcf82a797d9843dcc576ee0f5b84a45525d06c4d4cb8933cf376044a8734e0 |
|
MD5 | 10ddd0cc9b177c0aa580455d0c77d980 |
|
BLAKE2b-256 | 98a98bc66558b06d99862aa84f85995f1ded8ff38fcd116467f9c371ba2ba51b |