Headless: force opaque PNG screenshots by default, add --screenshot-keep-alpha

Games often use the framebuffer alpha channel for non-visual purposes,
so saved PNGs could look fully transparent in image viewers. Force alpha
to 255 when writing PNG screenshots unless --screenshot-keep-alpha is
passed. The MSE comparison ignores alpha either way.
This commit is contained in:
Henrik Rydgård committed 2026-08-09 13:41:39 +02:00
1 parent 032781e301
commit 8c9bf04add
7 files changed
+19 -4

No files matched your search

+4
View File
@@ -108,6 +108,10 @@ test is kept in `<outputRoot>/logs/`.
- PNG, 512×272 (480×272 display in a 512-wide framebuffer), stored top-down
(row 0 = top of screen). The BMP output format is bottom-up per the BMP
spec; the flip is applied only when writing BMPs.
- The alpha channel is forced to 255 when writing PNGs (games often use alpha
for non-visual purposes, which would otherwise produce transparent-looking
images); pass `--screenshot-keep-alpha` to the headless binary to preserve
it (e.g. via a variant). The MSE comparison ignores alpha either way.
- Generated with `--graphics=software` they are fully deterministic: a
subsequent run produces byte-identical output, so `maxMse` can be 0.
- If rendering code changes the output, existing references may need