0.1.1 • Published 10 years ago

phantomjs-resemble v0.1.1

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

Resemble.js in PhantomJS

var Resemble = require('./phantomjs-resemble');
var fs = require('fs');

var image1 = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAcEBAQFBAcFBQcKBwUHCgwJBwcJD......";
var image2 = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4TIraHR0cDovL25zLmFkb2JlLmNvbS94Y......";

new Resemble().analysis(image1, function (data) {
  console.log(data);
  this.exit();
});

new Resemble().compare(image1, image2, function (data) {
  fs.writeFileSync('demo.png', new Buffer(data.imageDataUrl.replace('data:image/png;base64,', ''), 'base64'));
  this.exit();
}, 'ignoreColors');

Read more in test.js.

History

0.1.0: Support running in Windows by setting "binary" as "phantomjs.cmd" instead of "phantomjs"

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago