bread-theme: capture golden pywal palettes for reference wallpapers #29

Closed
opened 2026-09-26 12:29:16 +08:00 by Breadway · 4 comments
Owner

Before replacing wal, record what it produces today so the switch is measured against real pywal output.

  • Reference images covering the hard cases: the BOS default (beige bread photo, also as baseline/progressive JPEG, WebP, 24-bit and palette BMP, and a two-frame GIF), a dark/moody RGBA image, a saturated 4-bit palette image, a near-monochrome 8-bit gray gradient, the same gradient as 16-bit gray, and a bright screenshot-like RGBA image.
  • bread-theme/scripts/capture-goldens.py runs wal -i <img> -n -q in an isolated HOME and records color1-6, plus wal_colors, the full ordered list from pywal's own gen_colors. The goldens are committed under bread-theme/tests/fixtures/golden/.
  • The fixtures feed exact per-slot and full-list tests for the native extractor (ECO-30).
  • 16-bit input: ImageMagick's txt: prints #RRRRGGGGBBBB, and pywal's #.{6} keeps #RRRRGG. near-monochrome-16bit.png pins that quirk, which the extractor reproduces on purpose.

Part of epic PYWAL.

Before replacing `wal`, record what it produces today so the switch is measured against real pywal output. - Reference images covering the hard cases: the BOS default (beige bread photo, also as baseline/progressive JPEG, WebP, 24-bit and palette BMP, and a two-frame GIF), a dark/moody RGBA image, a saturated 4-bit palette image, a near-monochrome 8-bit gray gradient, the same gradient as 16-bit gray, and a bright screenshot-like RGBA image. - `bread-theme/scripts/capture-goldens.py` runs `wal -i <img> -n -q` in an isolated HOME and records color1-6, plus `wal_colors`, the full ordered list from pywal's own `gen_colors`. The goldens are committed under `bread-theme/tests/fixtures/golden/`. - The fixtures feed exact per-slot and full-list tests for the native extractor (ECO-30). - 16-bit input: ImageMagick's txt: prints `#RRRRGGGGBBBB`, and pywal's `#.{6}` keeps `#RRRRGG`. `near-monochrome-16bit.png` pins that quirk, which the extractor reproduces on purpose. Part of epic PYWAL.
Author
Owner

PR: #36

Captured golden color1-6 for 5 reference images (BOS default wallpaper downscaled + 4 synthetic: dark/moody, saturated/colourful, near-monochrome, bright/screenshot-like) via real wal -i in an isolated HOME. Committed under bread-theme/tests/fixtures/, feeding ECO-30's fidelity tests.

PR: https://git.breadway.dev/Breadway/bread-ecosystem/pulls/36 Captured golden color1-6 for 5 reference images (BOS default wallpaper downscaled + 4 synthetic: dark/moody, saturated/colourful, near-monochrome, bright/screenshot-like) via real wal -i in an isolated HOME. Committed under bread-theme/tests/fixtures/, feeding ECO-30's fidelity tests.
Author
Owner

Review: changes requested (see bread-ecosystem#36, #36 (comment)).

tests/fixtures/golden/near-monochrome.json is not a valid golden. The fixture is a 16-bit grayscale PNG. ImageMagick's txt: output prints 12-digit hex for it (#78F078F078F0), and pywal's #.{6} regex truncates that to #78F078. That is where the green and purple come from; it is not dithering. Regenerate the fixture as 8-bit, or document it as a pywal parsing bug bread-theme deliberately does not reproduce, and correct the comment at output.rs:658-668.

Also replace the hue-family assertions (assert_hue_family, output.rs:600-617, which passes if any one of six accents is within 45 degrees) with per-slot comparisons against the goldens. Add webp and gif fixtures.

Rework happens on the existing branch feature/native-palette, and PR #36 stays open. Do not open a second PR for this key.

Review: changes requested (see bread-ecosystem#36, https://git.breadway.dev/Breadway/bread-ecosystem/pulls/36#issuecomment-1075). `tests/fixtures/golden/near-monochrome.json` is not a valid golden. The fixture is a 16-bit grayscale PNG. ImageMagick's `txt:` output prints 12-digit hex for it (`#78F078F078F0`), and pywal's `#.{6}` regex truncates that to `#78F078`. That is where the green and purple come from; it is not dithering. Regenerate the fixture as 8-bit, or document it as a pywal parsing bug bread-theme deliberately does not reproduce, and correct the comment at output.rs:658-668. Also replace the hue-family assertions (`assert_hue_family`, output.rs:600-617, which passes if any one of six accents is within 45 degrees) with per-slot comparisons against the goldens. Add webp and gif fixtures. Rework happens on the existing branch feature/native-palette, and PR #36 stays open. Do not open a second PR for this key.
Author
Owner

Rework pushed to the existing PR: #36 (commit 6e34f3b; summary at #36 (comment)).

The goldens are now captured by bread-theme/scripts/capture-goldens.py. Each one holds color1-6 from real wal -i in an isolated HOME, plus the full wal_colors list from pywal's own gen_colors. The near-monochrome diagnosis was right: it is pywal's #.{6} truncating 16-bit #RRRRGGGGBBBB output, not dithering. That fixture is kept as near-monochrome-16bit.png so the quirk (which the extractor reproduces) stays pinned, and near-monochrome.png is now 8-bit. New JPEG (baseline and progressive), WebP, BMP (24-bit and palette) and animated GIF fixtures were added. assert_hue_family is gone: every fixture is asserted exactly, both per slot and on the full list.

Rework pushed to the existing PR: https://git.breadway.dev/Breadway/bread-ecosystem/pulls/36 (commit 6e34f3b; summary at https://git.breadway.dev/Breadway/bread-ecosystem/pulls/36#issuecomment-1117). The goldens are now captured by bread-theme/scripts/capture-goldens.py. Each one holds color1-6 from real `wal -i` in an isolated HOME, plus the full `wal_colors` list from pywal's own gen_colors. The near-monochrome diagnosis was right: it is pywal's `#.{6}` truncating 16-bit `#RRRRGGGGBBBB` output, not dithering. That fixture is kept as near-monochrome-16bit.png so the quirk (which the extractor reproduces) stays pinned, and near-monochrome.png is now 8-bit. New JPEG (baseline and progressive), WebP, BMP (24-bit and palette) and animated GIF fixtures were added. `assert_hue_family` is gone: every fixture is asserted exactly, both per slot and on the full list.
Author
Owner

Second-round review: the goldens are correct. I re-captured them against real wal -i in an isolated HOME, and all committed fixtures match every accent slot and the full colour list (96/96 accents including the jpeg/ fixtures and the BOS default). The tests assert exact per-slot and full-list values, which is observable behaviour, not a mirror of the implementation. This stays in review: it ships in bread-ecosystem#36, which is held for the ECO-30 allocation fix and is on the release train (the user merges it). Details: #36 (comment)

Second-round review: the goldens are correct. I re-captured them against real `wal -i` in an isolated HOME, and all committed fixtures match every accent slot and the full colour list (96/96 accents including the jpeg/ fixtures and the BOS default). The tests assert exact per-slot and full-list values, which is observable behaviour, not a mirror of the implementation. This stays in review: it ships in bread-ecosystem#36, which is held for the ECO-30 allocation fix and is on the release train (the user merges it). Details: https://git.breadway.dev/Breadway/bread-ecosystem/pulls/36#issuecomment-1148
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/bread-ecosystem#29
No description provided.