Skip to content

cutting-room-floor/image-equal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-equal

build status Coverage Status

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.

install

npm install --save-dev image-equal

imageEqual

Assert that two images are similar.

Parameters

  • buffer Buffer input buffer
  • fixture Buffer expectation buffer
  • options [Object] (optional, default {})
    • options.diffsize [number] (optional, default 0.10)
    • options.diffpx [number] (optional, default 0.02)
    • options.threshold [number] (optional, default 16)

Examples

t.ifError(imageEqual(result, expectation));