Skip to content

thiago-rocha/Image-Comparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

ImageComparator

==========

Compare image pixel values with a threshold using phantomjs.

Getting Started

==========

Import the library:

phantom.page.injectJs( 'ImageComparator.js');

Creat a instance of ImageComparator:

var imageComparator = new ImageComparator();

Call function compare and pass two image to be compared a threshold and a callback function as argument.

imageComparator.compare('file:///..fullpath../image1.png', 'file:///..fullpath../image2.png', 0.001, function(result) {
        console.log(result);
        phantom.exit();
    });

result are 0 if the difference is less than the threshold and 1 if the difference is greater than the threshold.

About

Compare image pixel values with a threshold using phantomjs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published