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
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
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.2.tar.gz
(7.5 kB
view hashes)
Built Distribution
Close
Hashes for image_diff-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d991ba838796de8a77f729365452494a0216cf1324e262086948b560c7663e8 |
|
MD5 | b2f5ad510b31559f0f5b4a4837ed2ff0 |
|
BLAKE2b-256 | 8ef6729c05dd061927896799938675cb6388efa0fefd13dd4992c094dddc6bd6 |