mapbox / pixelmatch

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

Get infos when run #103

Closed jehon closed 2 years ago

jehon commented 2 years ago

Is it possible to generate the diff AND to get a structured info?

Style: { diff: 0.15 } or something like that...

Objective: to compare and to know if the comparison lead to a lot of change or not...

PS: no idea what the result should be, be an information in form of % would be nice (I mean independent of the size of the picture)

mourner commented 2 years ago

pixelmatch returns the number of different pixels after comparison. If you need %, just do numDiffPixels / (width * height).

jehon commented 2 years ago

Could be documented :-)