Skip to main content

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


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 details)

Uploaded Source

Built Distribution

SSIM_PIL-1.0.14-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file SSIM-PIL-1.0.14.tar.gz.

File metadata

  • Download URL: SSIM-PIL-1.0.14.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.2.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.6rc1

File hashes

Hashes for SSIM-PIL-1.0.14.tar.gz
Algorithm Hash digest
SHA256 7d9f9066bc268570d29145532e5b4cc6fefc1974aaf5f0a31773fc391b13c898
MD5 84ce5587ce334c66673aaeecbe343ad5
BLAKE2b-256 23c35538bdb2654005bc162d4fdf49c21de11fb03d317077d21c885d950febbc

See more details on using hashes here.

File details

Details for the file SSIM_PIL-1.0.14-py3-none-any.whl.

File metadata

  • Download URL: SSIM_PIL-1.0.14-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.2.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.6rc1

File hashes

Hashes for SSIM_PIL-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 c33b7d269f21d3de1509de3a4a21ff2445c9d5e1c8f732aef5e00839ae6a0b49
MD5 f31ef0a27ac3a6f29c781959fc62c716
BLAKE2b-256 07d2432fcd360b617fc1787f104fd7c608a10a752f6277755517a57d4b1fbac6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page