diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-28 16:33:33 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-28 16:33:33 +0800 |
| commit | 3732fece2285e386c1a5ba65aa45a31e467e1217 (patch) | |
| tree | 2a62bb39186ee2af04663859a2bf5c21d42a119e /scripts | |
| parent | b94ae560c652e8a5e759630acc079d834673c95a (diff) | |
| download | living-village-3732fece2285e386c1a5ba65aa45a31e467e1217.tar.gz | |
test(p40): 连贯带/同seed/夜光回归 + 运行时证据帧
- P40ArtTests 6 例:连贯带覆盖路网且抑制孤立散布、摆放确定性、红灯笼落门口、
红/石灯笼同光晕路径、同 seed 重生成一致、P40 索引在界内
- AssetPackTests 索引列表加 19/20;fsproj 注册 P40ArtTests
- scripts/make-p40-closeups.py 乌篷船 2x NEAREST 特写
- docs/维护说明.md 追加 P40 小节;证据 4 帧白块检查 0 命中,重复运行 byte-identical
- Release 全量 Desktop 201/201、Kernel 119/119 exit 0
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/make-p40-closeups.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/make-p40-closeups.py b/scripts/make-p40-closeups.py new file mode 100644 index 0000000..1add13e --- /dev/null +++ b/scripts/make-p40-closeups.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +"""P40 evidence: NEAREST 1x->2x close-up of the Wu Peng boat at a doorway cluster. + +Takes the real 1280x720 game frames captured by the `LV_P40_SHOT=1` hook and +crops the boat region, upscaling exactly 2x with NEAREST so pixel edges stay +sharp (no mixed colours). Deterministic: fixed crop box, pure function of the +input PNG, so running twice yields byte-identical output. + +Usage: + python3 scripts/make-p40-closeups.py <record-dir> <out-dir> +""" + +import sys +from pathlib import Path + +from PIL import Image + +# (source frame, crop box x0,y0,x1,y1, output name) +CROPS = [ + ("p40-boat.png", (524, 288, 724, 408), "p40-boat-closeup-2x.png"), +] + + +def main(argv): + if len(argv) != 3: + sys.stderr.write(__doc__) + return 2 + record_dir = Path(argv[1]) + out_dir = Path(argv[2]) + out_dir.mkdir(parents=True, exist_ok=True) + for source_name, box, out_name in CROPS: + source = Image.open(record_dir / source_name).convert("RGBA") + crop = source.crop(box) + doubled = crop.resize((crop.width * 2, crop.height * 2), Image.NEAREST) + doubled.save(out_dir / out_name) + print(f"ok {out_name} {doubled.width}x{doubled.height} from {source_name} box={box}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv)) |
