mapbox / pixelmatch

The smallest, simplest and fastest JavaScript pixel-level image comparison library
ISC License
6.15k stars 305 forks source link

Prevent diff to be generated if threashold not reached #112

Open bluepioupiou opened 2 years ago

bluepioupiou commented 2 years ago

Hi,

I use pixelmatch to compare the whole bunch of screenshots i've been taking for each version of my product (approx 300 screenshots) I use the binary to test each new screenshots against the previous one. But even if there is no differences (or if the diff threshold ins't reach), I still have a diff file generated which make the tester job quite difficult since he has to go through 300 files, even if there is no différence at all.

Can't you prevent the diff file to be writen if the threshold is not reached ?

mourner commented 2 years ago

Aren't you able to control this on your side? Run pixelmatch without diff, then run it again if there are differences above the threshold (which shouldn't happen often in tests, so performance isn't a concern)?

bluepioupiou commented 2 years ago

It could be a workaround indeed. But even with this, how can I tell the diff between the two doff files ?

AndI found it a bit heavy and would prefer if the tool don't generate a file to show that there is no diff...