summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-28 15:58:43 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-28 15:58:43 +0800
commitceb45d4006426d616aef099aaf16f5c1d827e816 (patch)
treec67af5bc00c9cb3ef143986a292e9f7407d1030f /scripts
parent3460c31b3bce6ee417e1aae95071992ba60fbf63 (diff)
downloadliving-village-ceb45d4006426d616aef099aaf16f5c1d827e816.tar.gz
test(p39): 摆放/光晕/奇偶 spacing 回归 + 运行时证据帧
- P39ArtTests 9 例:桥/船/灯笼/摊位/芦苇地形与确定性、NightLightTilesIncludeRoadLanterns、 StallsAndLanternsDoNotOverlapForOddAndEvenSpacing(奇 {3,5,7,11,13}/偶 {2,4,6,8,12})、 DegenerateSpacingPlacesNothing({0,1,-3} 返回空集) - AssetPackTests 更新为 19 格 + 新索引;fsproj 注册 P39ArtTests - scripts/make-p39-closeups.py:2x NEAREST 特写 - docs/维护说明.md 追加 P39 小节;证据 5 帧白块检查 0 命中,重复运行 byte-identical - Release 全量 Desktop 195/195、Kernel 119/119
Diffstat (limited to 'scripts')
-rw-r--r--scripts/make-p39-closeups.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/make-p39-closeups.py b/scripts/make-p39-closeups.py
new file mode 100644
index 0000000..750b181
--- /dev/null
+++ b/scripts/make-p39-closeups.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+"""P39 evidence: NEAREST 2x close-ups of the new Jiangnan elements.
+
+Takes the real 1280x720 game frames captured by the `LV_P39_SHOT=1` hook and
+crops the new-element regions, upscaling exactly 2x with NEAREST so pixel edges
+stay sharp (no mixed colours). Deterministic: fixed crop boxes, pure function of
+the input PNGs, so running twice yields byte-identical output.
+
+Usage:
+ python3 scripts/make-p39-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 = [
+ ("p39-day.png", (500, 180, 820, 420), "p39-closeup-2x.png"),
+ ("p39-lantern-night.png", (150, 270, 470, 450), "p39-closeup-lantern-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))