master
Colby Knox Full test suite in the page repo: npm test runs here (the published package carries only test/brand.mjs) 625499c
# Compare two parity runs pixel by pixel. Exit 1 on any difference.
import sys, os
from PIL import Image, ImageChops
a_dir, b_dir = sys.argv[1], sys.argv[2]
bad = 0
for f in sorted(os.listdir(a_dir)):
    if not f.endswith('.png'):
        continue
    a = Image.open(os.path.join(a_dir, f)).convert('RGB')
    b = Image.open(os.path.join(b_dir, f)).convert('RGB')
    if a.size != b.size:
        print(f, 'SIZE MISMATCH', a.size, b.size)
        bad += 1
        continue
    bbox = ImageChops.difference(a, b).getbbox()
    if bbox is None:
        print(f, 'identical')
    else:
        print(f, 'DIFF bbox', bbox)
        bad += 1
sys.exit(1 if bad else 0)