mapbox / pixelmatch

The smallest, simplest and fastest JavaScript pixel-level image comparison library
ISC License
6.15k stars 305 forks source link

Setting alpha makes image black and not original color #93

Closed joaogarin closed 3 years ago

joaogarin commented 3 years ago

Hello,

Thanks for the great and simple library. I was trying it out and wanted to do a diff between 2 images but keep the original image colors instead of the default white which looking at the docs comes form the alpha setting :

alpha — Blending factor of unchanged pixels in the diff output. Ranges from 0 for pure white to 1 for original brightness. 0.1 by default.

Is this not what the alpha does? If I set the alpha to 1 it becomes more towards a black color

joaogarin commented 3 years ago

I think using the diffMask property allows me to achieve this same end goal by just placing the diff on top of the original version. So looks like all good for me. I will close this issue.