v8.2.0
π Improvements:
Add an ability to calculate image difference and image equality simultaneously
If you need both co compare images and create diff image, you can pass option createDiffImage: true
,
it would work faster than two separate function calls:
const {
equal,
diffImage,
differentPixels,
totalPixels,
diffBounds,
diffClusters
} = await looksSame('image1.png', 'image2.png', {createDiffImage: true});
if (!equal) {
await diffImage.save('diffImage.png');
}