# Screenshot baselines The approved look of every screen, one PNG per `--capture` screenshot (`-.png`, as `Chronos.exe`, `Chronos.Uploader.exe` and `Chronos.Setup.exe --capture ` write them). CI compares each new screenshot with the file of the same name here (BRIEF ยง20.2, visual regression with a pixel-diff tolerance): ``` dotnet run --project src/Chronos.Tools -- screenshots diff out/screenshots --out out/screenshot-diff ``` - A pixel differs when one of its channels moves by more than `--tolerance` (default 8 of 255); a screen fails when more than `--max-diff` of its pixels differ (default 0.0005, that is 0.05 %), when its size changed, or when a baseline here has no screenshot any more. - A screenshot without a baseline fails as soon as this folder holds any PNG: a pull request that adds a screen adds its baselines too. - While this folder holds no PNG nothing is compared: the step passes, with a warning in the log saying that no visual change can fail it. - `out/screenshot-diff` gets `-diff.png` for every screen with differing pixels (the baseline faded to grey, the differences magenta) and `summary.md`; they stay in the work folder of the Windows runner (Gitea Actions keeps no artifacts here), and the job log lists every screen that failed. ## The pictures are reproducible The capture runs on sample data whose clock stands at `SampleData.Now` (2026-10-02 10:18 UTC), in English with English formats and with animations off, so the same code draws the same pixels on any day. Two things still come from the machine: - the time zone: times are shown in local time, and the baselines are made on the Windows runner of CI's `windows` job (`WINDOWS_RUNNER`), which compares them in its own time zone; - a few measured values: the server's response time and the time and duration of the last sync comparison. They change a few dozen pixels, well inside the allowed fraction. ## Adding or updating baselines Take them from CI, never from another PC (fonts, scaling and the time zone differ). On the Windows runner, every same-repository pull request pushes its screenshots to the `ci-screenshots` branch (one commit, the PNGs at its root). After checking them: ``` git fetch origin ci-screenshots git worktree add ../ci-screenshots origin/ci-screenshots dotnet run --project src/Chronos.Tools -- screenshots accept ../ci-screenshots git worktree remove ../ci-screenshots ``` `screenshots accept ` copies every PNG of `` here. Commit only the screens whose change is intended, and delete the baseline of a screen that no longer exists. ## The first baselines None is committed yet. Screenshots captured before the capture was made reproducible cannot serve: their times and dates follow the moment they were taken (a job finished at "12:18 AM", sample sequences dated from that day). The first baselines are accepted, all at once, from the `ci-screenshots` commit of the first green `windows` job run whose code captures at `SampleData.Now`; from that commit on, every screen is gated.