How to use pngjs

Comprehensive pngjs code examples:

How to use pngjs.sync:

33
34
35
36
37
38
39
40
41
42
43
44
    m._compile(`async function f(page, arg){ ${content} } module.exports.f = f;`, filename);
    return m.exports.f;
}


function comparePixels(img1, img2, debug_log) {
    const a = PNG.sync.read(fs.readFileSync(img1));
    const b = PNG.sync.read(fs.readFileSync(img2));


    if (a.height !== b.height || a.width !== b.width) {
        return false;