Skip to main content

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

Similar projects

  • pixelmatch by Mapbox is a JavaScript library with an accompanying CLI tool.

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

Release files for image-diff 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 image-diff 0.2.2
File Size Uploaded
image-diff-0.2.2.tar.gz 7.5 kB Details

Built distribution (wheel)

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

Total release size: 15.6 kB

Release files / image-diff-0.2.2.tar.gz

Download URL image-diff-0.2.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8175c67e4b42291511ba4e8974812dc211c3d18bb9e27a8273499c0590f7547e
BLAKE2b-256 checksum
How to use checksums
d9d1f0e5ba112635daaca833059c50e32fb177dbe7eb9ea4a6b283c9363ce891
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

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

Download URL image_diff-0.2.2-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d991ba838796de8a77f729365452494a0216cf1324e262086948b560c7663e8
BLAKE2b-256 checksum
How to use checksums
8ef6729c05dd061927896799938675cb6388efa0fefd13dd4992c094dddc6bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2

2 release files

0.1

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