Files

23 lines
1.1 KiB
Bash

#!/bin/bash
python3 - <<'EOF'
from PIL import Image
import numpy as np
pairs = [
('legacy-1', '/mnt/f/efi/Paravis/Boot/xor/Main1.bmp', '/path/to/pf/KRD/images/legacy-1.png'),
('legacy-2', '/mnt/f/efi/Paravis/Boot/xor/Main2.bmp', '/path/to/pf/KRD/images/legacy-2.png'),
('x64-1', '/mnt/f/efi/Boot/1x64.bmp', '/path/to/pf/KRD/images/x64-1.png'),
('x64-2', '/mnt/f/efi/Boot/2x64.bmp', '/path/to/pf/KRD/images/x64-2.png'),
('x86-1', '/mnt/f/efi/Boot/1x86.bmp', '/path/to/pf/KRD/images/x86-1.png'),
('x86-2', '/mnt/f/efi/Boot/2x86.bmp', '/path/to/pf/KRD/images/x86-2.png'),
]
for name, bmp, png in pairs:
a = np.array(Image.open(bmp).convert('RGB'))
b = np.array(Image.open(png).convert('RGB'))
same = a.shape == b.shape and np.array_equal(a, b)
diff = None if a.shape != b.shape else int(np.abs(a.astype(int)-b.astype(int)).max())
print(f' {name:9s} bmp={a.shape} png={b.shape} equal={same} maxdiff={diff}')
if not same:
Image.fromarray(a).save(f'/path/to/pf/KRD/check-{name}.png')
EOF