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)
# 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.
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
SSIM-PIL-1.0.14.tar.gz
(6.9 kB
view hashes)
Built Distribution
SSIM_PIL-1.0.14-py3-none-any.whl
(11.1 kB
view hashes)
Close
Hashes for SSIM_PIL-1.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c33b7d269f21d3de1509de3a4a21ff2445c9d5e1c8f732aef5e00839ae6a0b49 |
|
MD5 | f31ef0a27ac3a6f29c781959fc62c716 |
|
BLAKE2b-256 | 07d2432fcd360b617fc1787f104fd7c608a10a752f6277755517a57d4b1fbac6 |