I am trying to do a comparison of 2 images and highlight the difference in a third Image using node-resemble-js.
Tried the following code:
var imgData1 = 'C:\\Users\\Image1.png';
var imgData2 = 'C:\\Users\\Image2.png';
var diffImage = 'C:\\Users\\';
resemble(imgData1).compareTo(imgData2).ignoreNothing().onComplete(function (data) {
data.getDiffImage().pack().pipe(fs.createWriteStream( diffImage + 'diff.png'));
console.log(data);
})
But, getting an empty ‘diff’ image. The log shows that the 2 images are different:
{ isSameDimensions: true,
dimensionDifference: { width: 0, height: 0 },
misMatchPercentage: '0.73',
analysisTime: 143,
getDiffImage: [Function] }
Don’t know what am I missing here, Any help would be much appreciated.