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.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: image-diff-0.2.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.tar.gz
Algorithm Hash digest
SHA256 8547193b154a425454b7603c0f8345ea70b014df243536e4fb269e61d4f35c11
MD5 dd719946c342bd30f418065b030a8b85
BLAKE2b-256 29e97a16cb5b5d68d0713eb98d9ec716e556c0a4e52b9256501532c28b0876d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: image_diff-0.2-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-py3-none-any.whl
Algorithm Hash digest
SHA256 f26e06c3167e013854024efcaf0ee52962ce74ea87eb7beb9a0bb1eed862277d
MD5 856dd1bb7a3398265c6f9a9f2e49e565
BLAKE2b-256 411c5b055ad1bbec23ece15c8bc6ced9d8a9ac86cf96c00ad11927d3710bd26a

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