compareImagePixel(fixture, actual, options = {}) {
        if (fixture.width !== actual.width || fixture.height !== actual.height) {
            return fixture.width * fixture.height;
        }
        const rgbaDelta = options.rgbaDelta || 6; // default rgba delta is 5
        const diffRatio = options.diffRatio || 0.01; //default diff ratio is 1% 
        const w = fixture.width, h = fixture.height;
        const canvas1 = document.createElement('canvas');
        const canvas2 = document.createElement('canvas');
        canvas1.width = canvas2.width = w;
        canvas1.height = canvas2.height = h;
        const ctx1 = canvas1.getContext('2d');
        const ctx2 = canvas2.getContext('2d');

        ctx1.drawImage(fixture, 0, 0);
        ctx2.drawImage(actual, 0, 0);

        const data1 = ctx1.getImageData(0, 0, w, h).data;
        const data2 = ctx2.getImageData(0, 0, w, h).data;
        
        let blank = -1; //blank in default
        let diffCount = 0;
        for (let i = 0, l = data1.length; i < l; i += 4) {
            if (blank === -1 && data2[i + 3] > 0) {
                blank = 0; //met 1st drawn pixel
            }
            for (let ii = 0; ii < 4; ii++) {
                const d = Math.abs(data1[i + ii] - data2[i + ii]);
                if (d > rgbaDelta) {
                    // console.log(Math.floor(i / 4), data1.slice(i, i + 4).join(' '), data2.slice(i, i + 4).join(' '));
                    diffCount += d;
                    break;
                }                
            }
        }
        if (diffCount / (w * h) > diffRatio) {
            // console.log('diff count', diffCount);
            return diffCount;
        }
        return blank;
    }
Compare image pixel difference
@param {Buffer} fixture
@param {Buffer} actual
@param {Number} colorDelta Max. distance colors in the 4 dimensional color-space without triggering a difference. (default: 20)
@return {Number} -1 : blank image, 0: same, > 0 : color delta