travel-photo-abstraction
Analyze the photograph uploaded by the user, deconstruct its visual evidence, abstract and distill the essential relationships, then reconstruct them as a new nonliteral lower-panel composition guided by 19 bundled references. Use for CLEAN upper-photo/lower-abstraction editorial artworks with a number, date, and short phrase in the lower panel. This is abstraction and reconstruction, never style conversion or a miniature redraw. Preserve the exact user-uploaded photograph unchanged above.
1How It Works & Mechanism
The core of the process is prompt orchestration based on 'visual evidence → minimalist symbol mapping' rather than algorithms: the skill defines the generation task into three stages: Deconstruct → Abstract/distill → Reconstruct. The model must first compile an evidence checklist of the source image, map it into symbols, and finally reconstruct it into a sparse layout.
Treat the task as three deliberate operations: **deconstruct**, **abstract/distill**, and **reconstruct**. The lower panel is a new visual composition made from relationships extracted from the upper photograph. It is neither a miniature redraw nor a style-converted copy.
The 'Deconstruct-Reconstruct' workflow is divided between the upper generative model and lower deterministic Python scripts: the abstract lower panel is handed to the built-in image generation tool, while image composition, micro-typography typesetting, and machine validation are all handled by local scripts to prevent the generative model from tampering with the photo or producing erroneous text.
Supply the image tool with locked `USER_PHOTO` plus 3–4 selected bundled references in one generation call (the tool accepts at most five images total). Label roles explicitly: `Image 1 = USER-UPLOADED CONTENT SOURCE ONLY`; `Images 2–N = BUNDLED LOWER-PANEL STYLE REFERENCES ONLY`. Generate only `GENERATED_PANEL`.
Deliverables can only be produced by finalize_artwork.py, which sequentially executes compose_artwork.py (composition) + validate_output.py (validation); any failure at any step deletes the output and refuses delivery (fail-closed).
try: subprocess.run(compose, check=True) subprocess.run( [sys.executable, str(scripts / "validate_output.py"), str(output), "--original", str(original)], check=True, ) except (subprocess.CalledProcessError, OSError): if output.is_file(): output.unlink() raise SystemExit("FINALIZATION FAILED: invalid output removed; deliver no artwork")
Pixel-level photo integrity is guaranteed by validate_output.py via machine checks: the top of the final image is cropped to the exact dimensions of the source photo and compared pixel-by-pixel using ImageChops.difference, requiring zero difference.
photo_match = None actual = image.crop((0, 0, source.width, source.height)) photo_match = native_dimensions and ImageChops.difference(actual, source).getbbox() is None
The three micro-typography elements (NO. 00X / DD MON YYYY / UPPERCASE PHRASE) are strictly validated via regex and drawn deterministically; the generative model is prohibited from rendering any text in the canvas.
NUMBER_RE = re.compile(r"^NO\. \d{3}$") DATE_RE = re.compile(r"^\d{2} [A-Z]{3} \d{4}$") PHRASE_RE = re.compile(r"^[A-Z0-9]+(?: [A-Z0-9]+){0,2}$")
19 bundled style reference images constitute an 'approved visual grammar library', strictly separated from the source photo's content channel; references only lend abstract grammar, density, and whitespace, not content or legacy layouts.
Use the selected lower panels to guide abstraction vocabulary, mark-making, scale contrast, restrained color, editorial quietness, and poetic negative space. The current `USER_PHOTO`, not the references, supplies the miniature's complete composition, aspect ratio, topology, and element coordinates. Do not copy reference subjects or exact compositions.
Installation self-check and operational gatekeeping: check_installation.py verifies that all required files and the 19 reference images are present, failing if anything is missing; SKILL.md also requires verifying that the host's built-in image tool is callable before generation, halting immediately otherwise.
1. Run `scripts/check_installation.py`. Stop and report an incomplete installation if it fails. 2. Confirm that a built-in image generation tool is callable. If it is absent, unavailable, denied, or fails, stop and tell the user.
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| api | 宿主内置图像生成工具(built-in image generation tool) |
| package | Python Pillow(PIL) |
4Recommended Governance & Evidence
- scripts/: Execute local script or command: travel-photo-abstraction/scripts/check_installation.py (installation self-check, pure file existence check)
- 网络端点: Declare external network access: Zero network calls in SKILL.md or script source code (repository-wide token scanning for URL/curl/wget/requests only matches git cl in README)
- 本地工作目录: File read/write and artifact output: compose_artwork.py writes the final composite image to the path specified by --output and automatically creates parent directories (output.parent.mkdir(parent
5Second-Pass Verification
- [ok] 像素保真由机器验证而非口头承诺 — validate_output.py 第 90 行附近 ImageChops.difference(actual, source).getbbox() is None + native_dimensions 判定,README『pixel-verify』无夸大。
- [ok] finalize_artwork.py 只调兄弟脚本、无外带载荷 — subprocess 参数 = sys.executable + scripts/ 下 compose_artwork.py/validate_output.py + 本地路径与正则校验过的三文本;无 shell=True、无环境变量透传。
- [ok] 无网络调用、无凭证读取结论 — 全仓 token 扫描命中仅两处:README git clone URL(人用安装命令)与 finalize 本地 subprocess;os.environ/getenv/keyring/api_key 等零命中。
- [ok] 19 张样式参考真实存在且为图 — PNG 头逐一验证 memory-reference-001..019.png 均为合法 PNG,竖幅、尺寸各异;check_installation.py 的断言与文件清单一致。
- [ok] 文本三件套仅由确定性脚本添加(生成阶段禁字) — compose_artwork.py 正则 NUMBER_RE/DATE_RE/PHRASE_RE + ImageDraw 绘制;SKILL.md 第 10、11 步与 prompt scaffold『Text: generate no text of any kind』双重印证。
- [ok] 背景 CLEAN 契约可机器核验 — validate_output.py 6 采样点 (0.12,0.18)(0.50,0.18)(0.12,0.48)(0.88,0.48)(0.50,0.88)(0.88,0.88) + channel_span≤4.0 + lower_brightness≥205 判定存在。
- [ok] 依赖清单完备性(有无漏掉 CLI/包) — 可执行代码只用 sys.executable/subprocess 调兄弟脚本与 Pillow(import 处显式报错提示);字体走系统字体候选列表(DejaVuSansMono.ttf/consola.ttf/Menlo.ttc)失败则 fallback load_default,非硬依赖。无 gh/git/ffmpeg/yt-dlp 等外部 CLI。
- [ok] commit/metadata 一致 — git HEAD==96e387635edf==pin;GitHub API:stars 749、pushed_at 2026-08-03T00:24:09Z(与本地最后提交同时刻)、license spdx NOASSERTION(仓库 LICENSE 为自拟 Source-Available 1.0,README 明示非 OSI 开源)。
6Verdict & Scenarios
013e3c7b5205fbdc…