Assert that two images are similar. This is useful for testing applications with visual output, like those that work with node-canvas or WebGL. Due to platform differences, images generated by these applications are often slightly different in terms of anti-aliasing or other details, but are 'close enough' that you want to accept the result.
npm install --save-dev image-equal
Assert that two images are similar.
buffer
Buffer
input bufferfixture
Buffer
expectation bufferoptions
[Object]
(optional, default{}
)options.diffsize
[number]
(optional, default0.10
)options.diffpx
[number]
(optional, default0.02
)options.threshold
[number]
(optional, default16
)
t.ifError(imageEqual(result, expectation));