diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-28 18:48:05 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-28 18:48:05 +0800 |
| commit | d3a2604e30b1deb91afebf550a79cde71bbca6d6 (patch) | |
| tree | 7cf10505e76f5a6749faadb96ff4d678a3c8fb26 /scripts/make-p42-menu-closeup.py | |
| parent | 323552b7e49550d378d3871fadcb711c16c71fed (diff) | |
| download | living-village-d3a2604e30b1deb91afebf550a79cde71bbca6d6.tar.gz | |
p42: 启动/菜单水面涟漪整改 — 振幅0.32+波峰列, 帧差14.3, 防降振回归 (leader fix: 提交+推送)
Diffstat (limited to 'scripts/make-p42-menu-closeup.py')
| -rw-r--r-- | scripts/make-p42-menu-closeup.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/make-p42-menu-closeup.py b/scripts/make-p42-menu-closeup.py new file mode 100644 index 0000000..64d885f --- /dev/null +++ b/scripts/make-p42-menu-closeup.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +"""P42 evidence: NEAREST 2x close-up of the animated start-menu band. + +Crops the lower scene band of the `LV_P42_SHOT=1` menu frame -- the bank lanterns +and the rippling water band -- and upscales exactly 2x with NEAREST so pixel edges +stay sharp. Deterministic: fixed crop box, pure function of the input PNG. + +Usage: + python3 scripts/make-p42-menu-closeup.py <record-dir> <out-dir> +""" + +import sys +from pathlib import Path + +from PIL import Image + +CROPS = [ + ("p42-menu-anim.png", (160, 440, 1120, 720), "p42-menu-anim-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)) |
