Skip to main content

compimg

PyPI PyPI - Python Version PyPI - Wheel License Documentation Status PyPI - Downloads

Branches:
master: CircleCI
develop: CircleCI

Introduction

For full documentation visit documentation site.

Image similarity metrics are often used in image quality assessment for performance evaluation of image restoration and reconstruction algorithms. They require two images:

  • test image (image of interest)
  • reference image (image we compare against)

Such metrics produce numerical values and are widely called full/reduced-reference methods for assessing image quality.

compimg package is all about calculating similarity between images. It provides image similarity metrics (PSNR, SSIM etc.) that are widely used to asses image quality.

import numpy as np
from compimg.similarity import SSIM
some_grayscale_image = np.ones((20,20), dtype=np.uint8)
identical_image = np.ones((20,20), dtype=np.uint8)
result = SSIM().compare(some_grayscale_image, identical_image)
assert result == 1.0 # SSIM returns 1.0 when images are identical

Features

  • common metrics for calculating similarity of one image to another
  • images are treated as numpy arrays which makes compimg compatible with most image processing packages
  • only scipy (and inherently numpy) as a dependency

Installation

compimg is available on PyPI. You can install it using pip:
pip install compimg

Note

Keep in mind that metrics are not aware of what kind of image you are passing. If metric relies on intensity values and you have YCbCr image you should probably pass only the first channel to the computing subroutine.

Help

If you have any problems or questions please post an issue.

Metadata

Release files for compimg 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compimg 0.2.2
File Size Uploaded
compimg-0.2.2.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compimg 0.2.2
File Interpreter ABI Platform
compimg-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / compimg-0.2.2.tar.gz

Download URL compimg-0.2.2.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c509d42f5d822edabe010ceee9220301494d5133e56118e1823cc70d2a1cd906
BLAKE2b-256 checksum
How to use checksums
f47c6ba9b914f6d52dc1b9800ec0b72b7c860d7688e5e04fdd067ab41bca7fab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / compimg-0.2.2-py3-none-any.whl

Download URL compimg-0.2.2-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab1c7be397321ccc8a0f655164a5e807a7ae35e8a87ae13bbc5b9cc73cb9c313
BLAKE2b-256 checksum
How to use checksums
6b4e94b59f83d899445366c68db9dbfedb5246a06c9e01e96c8a3a30e38c6d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page