Skip to main content

ez_img_diff

A tool for doing quick percieved image difference analysis

What does ez_img_diff do?

ez_img_diff is a CLI and api for doing a simple form of percieved image difference analysis with SSIM. This allows for tons of features, but the main one is being able to compare some sort of "baseline" image of an application to a "current" itteration in visual regression testing.

Down the road I will write a selenium integration to tie this whole process together!

Why should I use ez_img_diff?

There are a ton of great and more robust tools out there for this analysis, or for visual regression testing, but I found each of them had their own problems, here's a list:

Package Issue
needle Requires a Nose test runner, and had out of date dependencies
pytest-needle Works well, but cannot use webdiver_manager with it
dpxdt Didn't test, but was 7 years old and mostly focused on CI/CD usage
Visual Regression Tracker Works great, but for some of my use cases I need an API not a full application
hermione Could not use javascript/nodeJS for my use case
specter Could not use javascript/nodeJS for my use case
Cypress-image-screenshot Could not use javascript/nodeJS for my use case

Quick-start

Installation

From source

  1. Clone this repo: https://github.com/Descent098/ez-img-diff
  2. Run pip install . or sudo pip3 install .in the root directory

From PyPi

  1. Run pip install ez_img_diff

Examples

API Examples

Compare 2 images without saving difference files

from ez_img_diff.api import compare_images

img1 = "baseline.png"
img2 = "current.png"

compare_images(im1, img2) # 14.03

Compare 2 images with saving difference and threshold files

from ez_img_diff.api import compare_images

img1 = "baseline.png"
img2 = "current.png"

compare_images(im1, img2, "difference.png", "threshold.png") # 14.03

CLI Usage

ez img diff

A tool for doing quick perceptual image difference analysis

Usage: 
    img_diff [-h] [-v]
    img_diff (<img1> <img2>) [-o OUTPUT_FOLDER] 

Options:
    -h, --help            show this help message and exit
    -v, --version         show program's version number and exit
    -o OUTPUT_FOLDER, --output OUTPUT_FOLDER 
                        the folder to output difference files to

so for example to get the diff of two images use:

$> img_diff baseline.png current.png
14.03

You can then store the diff and threshold of the two images with:

$> img_diff baseline.png current.png -o results
14.03

$> cd results && ls
diff.png
thresh.png

Notes

Some things to keep in mind:

  • Output folder will have 2 files in it diff.png and thresh.png
    • diff.png is the regular difference png, which shows where things differ
    • thresh.png is the threshold png, which is much higher contrast and shows you where the biggest changes happened more clearly

Metadata

Release files for ez-img-diff 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ez-img-diff 0.1.0
File Size Uploaded Provenance Actions
ez_img_diff-0.1.0.tar.gz 6.2 kB Without provenance Details for ez_img_diff-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ez-img-diff 0.1.0
File Interpreter ABI Platform Actions
ez_img_diff-0.1.0-py3-none-any.whl Python 3 none any Details for ez_img_diff-0.1.0-py3-none-any.whl

Total release size: 13.0 kB

Release files / ez_img_diff-0.1.0.tar.gz

Download URL ez_img_diff-0.1.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c3031a83e50ad13f39a09fde4b211afce8e5e2be9faeb4c3c65ac1d65eb324ca
BLAKE2b-256 checksum
How to use checksums
db53d19a69bdbd57a0a59ea8a57e61372596af3e93797a432e632eed42d1fd6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / ez_img_diff-0.1.0-py3-none-any.whl

Download URL ez_img_diff-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94e4809c087174e72b8af59651db1bf14c95a8f96e656f9ea58ba1f3db04c2a5
BLAKE2b-256 checksum
How to use checksums
fab844e6acd5f5b8c4942039eddd323b08524068fd1a0d92a2159cb27eac3346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for ez-img-diff 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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