CLI tool for comparing images
Project description
image-diff
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 hashes)
Built Distribution
Close
Hashes for image_diff-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c01095c9950868ebb97ed71ea9d87e4e783726e5f10c658d58d1dafa3c888cea |
|
MD5 | 4ee6137e11997a518217136e3c810012 |
|
BLAKE2b-256 | fa88f1bfecc9fd68ef92192c9ec920c6bcfef6a01df246a5f0c9c160feef3a06 |