Skip to main content

CLI tool for comparing images

Project description

image-diff

PyPI Changelog Tests License

CLI tool for comparing images

Installation

Install this tool using pip:

$ pip install image-diff

Image diff

To generate an image showing the difference between two images:

image-diff first.jpg second.jpg -o diff.png

Count differing pixels

To count the number of pixels that have changed, use image-diff count:

image-diff first.jpg second.jpg

This will output a number followed by a newline.

Compile an image

The image-diff compile command exists mainly to make this tool easier to test.

It can be used to compile an image from a JSON definition - for example:

echo '[
    [[0, 0, 0], [0, 0, 0], [0, 0, 0]],
    [[0, 0, 0], [255, 0, 0], [0, 0, 0]],
    [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
]' | image-diff compile - -o one-pixel.png

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd image-diff
python -m venv venv
source venv/bin/activate

Or if you are using pipenv:

pipenv shell

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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

image-diff-0.2.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

image_diff-0.2.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file image-diff-0.2.1.tar.gz.

File metadata

  • Download URL: image-diff-0.2.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for image-diff-0.2.1.tar.gz
Algorithm Hash digest
SHA256 582020c3b1c2296248a00d932cca623417336f98f6da73d33609dba1833cd3dd
MD5 19a54c3cd55396745ff1e1271a3afc64
BLAKE2b-256 e1ff71df2239f64efe1104cbc32f5acb154496ebea71e950e9dd269097d2648a

See more details on using hashes here.

File details

Details for the file image_diff-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: image_diff-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for image_diff-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c01095c9950868ebb97ed71ea9d87e4e783726e5f10c658d58d1dafa3c888cea
MD5 4ee6137e11997a518217136e3c810012
BLAKE2b-256 fa88f1bfecc9fd68ef92192c9ec920c6bcfef6a01df246a5f0c9c160feef3a06

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