fuzi1.2.0-alpha • Public • Published
🚧 Alpha Version (Work in Progress)
API subject to change
🐻 fuzzy image diff'ing for the terminal
Support the development of Fuzi by becoming a patreon.
Need to check the difference between two images? Ask Fuzi! 🐻
$ fuzi red-square.png green-circle.jpg -v
- Diff images from the CLI
- Diff in API Mode for use in test frameworks
- Images do not have to match
- Size can be different
- Dimensions can be different
- File type can be different
- Supports file-types: PNG, JPG
- Configurable settings for tweaking each tests
Fuzi is an image diffing tool for Ref-Testing in a CI environment, (Travis, Circle, etc). Fuzi outputs graphics to your terminal, making it quicker to understand why a test is failing.
CLI plus API
Fuzi can diff in the CLI so that you can experiment and get used to it's inputs and outputs. Fuzi diff as a Node API to use in your testing framework.
Call it a "PASS"
When your tests fail in the cloud, Fuzi gives you the tolerance settings required to make the test pass the next time it runs. Phew!
For global use:
$ npm i -g fuzi$ yarn --global add fuzi
For local testing:
$ npm i --save-dev fuzi$ yarn add fuzi
How does Fuzi work?
Rather than try to compare the whole image, Fuzi splits each image into a spatial grid and compares the two. This helps to evaluated which parts of the image match, and which are different.
Fuzi splits your images into 4 channels to finds the average value for each grid square. These chanels are:
Fuzi then takes the tolerance parameter you provide, and compares the average chanel values in each square to see if they are above or below your threshold.
The thresholds default to 0:
const opts =tolerance:hue: 0sat: 0lum: 0alp: 0
PASS or FAIL
If any grid square's average channel value is above the tolerance (for any channel), your images are considered to be
This results in a
If all grid squares average channel values are below your provided tolerance threshold, then your images are considered to the