Files
cleanyourtv/tools
simandClaude Opus 5.5 7de6947bef tools: screendiff.py, before/after screenshots compared pixel by pixel, private details blurred
The third of the performance tools proposed in #564. Every performance PR claims Home looks the same;
this checks it, and makes the screenshots safe to post:

- Compares the two screenshots, leaving out the regions given with --mask (the clock moves on), and
  reports how many pixels differ by more than --threshold (default 8, compression noise) and where.
  Exit status 0 identical, 1 different, 2 an error, so a script can rely on it.
- Writes the pair side by side with --blur regions pixelated in both (the Wi-Fi name), and with
  --diff the differing pixels themselves.
- Boxes are checked before anything is read; one outside the picture, or screenshots of different
  sizes, are errors rather than a silent partial compare.
- tools/screendiff.md says how to find the boxes on your own layout with uiautomator, and what makes
  the comparison mean something.

Pillow was already added to tools/requirements-perf.txt for flamechart.py; nothing new to install.
The image tests skip without Pillow, so CI stays as it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 09:28:35 +10:00
..