Git Product home page Git Product logo

dfrnt's Introduction

dfrnt is a library for comparing PNG screenshots during automated testing and producing visual diffs.

dfrnt will compare images with identical names from automation and produce a result "diff" image that red-highlights regions
in the image that differ.

dfrnt requires a minimum of 3 folders to be specified:

run_dir is the directory of screenshots from your run, aka 'actual screenshots'
gold_dir directory of screenshots that are compared against, aka 'expected screenshots'
diff_dir is the directory to output the visual diff images into

Invoking:

1. You have a directory of images from your latest test run in "test/run" (test.png)
2. You have a directory of the expected images in "test/gold" (test.png)
3. You want the output of visual diffs to be placed in directory "test/diff"

from dfrnt import dfrnt

visual_diffs = dfrnt(run_dir="test/run", gold_dir="test/gold", diff_dir="test/diff")

visual_diffs.diff()

Output:
Diff failed! test.png is not identical enough

A red-lined image showing the differences between run/test.png and gold/test.png is generated in diff/test.png

Optional Features:
mask_dir is the directory to contain images with highlighted areas you wish to ignore in the diff.
This is useful for ignoring portions of an image that always change, like date / time.
These mask images should be transparent background PNGs

fuzzy is a "fuzziness" factor of how different images can be and still pass.
If you experience jitter you should experimentally determine the lowest acceptable number you can use.
Default is None, starting your binary search around '40' is recommended

visual_diffs = visual_diffs = dfrnt(run_dir="run", gold_dir="gold", diff_dir="diff", mask_dir="mask", fuzzy=40)

Why is this project called 'dfrnt'?
To mock the modern practice of dropping vowels in software names to sound unique. Be glad I didn't name it dfrntzlyr.

dfrnt's People

Contributors

lesterthetester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

pqyplzxhgf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.