Community이미지github.com

photo-compose

Local CPU-only non-destructive intelligent composition step for the photo pipeline (photo-cull -> photo-compose -> photo-develop -> photo-export). Analyses each photo-cull keeper for horizon/level (accidental tilt), verticals/perspective, saliency, focal elements, face gaze and movement space, then proposes and ranks rotation + smart-crop candidates and writes Camera Raw geometry XMP (straighten + crop + orientation) plus an interactive accept/reject/adjust report. Deterministic geometry in code; semantic/aesthetic judgment supplied by a multimodal agent via semantic.json. Use when the user asks to straighten horizons, level or fix tilt, crop or re-crop smartly, improve composition/framing, apply rule-of-thirds / golden ratio / negative space / gaze space, rotate photos, fix perspective or vertical lines, choose an aspect ratio, or to run/repair the composition step of a photo batch. Originals are read-only; nothing is written into the source except by photo-export's own Export folder.

photo-compose란 무엇인가요?

photo-compose is a OpenCode agent skill that local CPU-only non-destructive intelligent composition step for the photo pipeline (photo-cull -> photo-compose -> photo-develop -> photo-export). Analyses each photo-cull keeper for horizon/level (accidental tilt), verticals/perspective, saliency, focal elements, face gaze and movement space, then proposes and ranks rotation + smart-crop candidates and writes Camera Raw geometry XMP (straighten + crop + orientation) plus an interactive accept/reject/adjust report. Deterministic geometry in code; semantic/aesthetic judgment supplied by a multimodal agent via semantic.json. Use when the user asks to straighten horizons, level or fix tilt, crop or re-crop smartly, improve composition/framing, apply rule-of-thirds / golden ratio / negative space / gaze space, rotate photos, fix perspective or vertical lines, choose an aspect ratio, or to run/repair the composition step of a photo batch. Originals are read-only; nothing is written into the source except by photo-export's own Export folder.

지원 대상~Claude Code~Codex CLI~Cursor✓OpenCode
npx skills add https://github.com/jpb18/FototecaSkills/tree/HEAD/photo-compose

Installed? Explore more 이미지 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

photo-compose은(는) 무엇을 하나요?

Intelligent, reversible composition stage. It sits between photo-cull and photo-develop:

photo-cull -> photo-compose -> photo-develop -> photo-export

It never develops tone and never exports pixels; it only decides geometry (orientation, straighten angle, crop rectangle) and writes it as XMP + a JSON manifest + a review report.

Non-negotiables

  • Originals are read-only. No source edit, no source XMP overwrite, no sidecar written next to originals. Everything goes under --output.
  • Non-destructive and reversible. Geometry lives in XMP; the manifest keeps the original orientation, all candidates and every parameter.
  • Do not duplicate photo-develop. Tone/exposure/WB belongs to develop. photo-compose writes only crs:HasCrop/CropLeft/CropTop/CropRight/CropBottom/ CropAngle/Orientation (+ provenance).
  • Deterministic geometry. Crop fractions, angle, output resolution are computed in code. A model may supply semantics (scene, intent, protected regions, focal elements), never coordinates.
  • CPU only, no network. Models are the ones already bundled by siblings.
  • Siblings are reused, never reimplemented: photo-render (decode, orient, straighten+crop, XMP parse), photo-develop (raw decode, cull selection), photo-cull (scores.json, face model), photo-export (render+export).

Quick start

$S = "C:\path\session"

# 1) cull first (or reuse an existing pre-cull-report)
python "$env:USERPROFILE\.config\opencode\skills\photo-cull\scripts\run_pipeline.py" `
  --source $S --output "$S\pre-cull-report" --no-faces

# 2) compose: straighten + smart crop + XMP + report
python "$env:USERPROFILE\.config\opencode\skills\photo-compose\scripts\run_pipeline.py" compose `
  --source $S --cull "$S\pre-cull-report" --output "$S\photo-compose"

# 3) review: open $S\photo-compose\compose-report.html  (or serve + persist)
python "$env:USERPROFILE\.config\opencode\skills\photo-compose\scripts\run_pipeline.py" serve `
  --output "$S\photo-compose" --port 8765

# 4) apply accepted/rejected/adjusted decisions
python "$env:USERPROFILE\.config\opencode\skills\photo-compose\scripts\run_pipeline.py" apply-decisions `
  --output "$S\photo-compose" --decisions "$S\photo-compose\compose-decisions.json"

# 5) merge geometry into photo-develop XMP, then render/export
python "$env:USERPROFILE\.config\opencode\skills\photo-compose\scripts\run_pipeline.py" merge `
  --compose-xmp "$S\photo-compose\xmp" --develop "$S\photo-ai\xmp" --output "$S\xmp-merged"

One command for the whole chain (reusing siblings' CLIs):

python "$env:USERPROFILE\.config\opencode\skills\photo-compose\scripts\run_pipeline.py" pipeline `
  --source $S --work "$S\..\session-work" --sample 5

What it decides, in order

  1. Orientation — EXIF/CRS 1–8 applied first (same as photo-render).
  2. Straighten — measures the horizon tilt from line segments. Corrects only accidental tilt (|tilt| >= --min-angle-deg, default 0.4°, confidence ≥ 0.25, |angle| <= --max-angle-deg). Intentional tilt is preserved with --preserve-tilt or semantic.intentional_tilt.
  3. Crop — candidate crops per aspect; must keep the primary focal element fully inside, never slice a protected region, never leave the black-free (inscribed) area created by rotation, and keep at least --min-keep of the usable area.
  4. Selection — a candidate replaces the original only with clear improvement (--min-improvement, default 0.02). Well-composed photos are left untouched.

Scoring is a blend of thirds/golden points, balance, symmetry, level, framing, gaze space, movement space, negative space, context retention, resolution, primary-focus prominence and edge distraction. All are heuristics: a better photo is not automatically a rule-of-thirds photo, and a face is not automatically the subject.

Multimodal semantic pass (optional, recommended)

photo-compose writes semantic-template.json. A multimodal agent fills it, then re-runs compose with --semantic semantic.json:

{ "per_stem": {
  "DSC01234": {
    "scene": "portrait",
    "intentional_tilt": false,
    "symmetry": true,
    "focal_elements": [
      {"type": "person_face", "box": [0.31,0.18,0.52,0.44], "score": 0.9,
       "gaze": [0.8,0.1], "moving": false, "protect": true}
    ],
    "protected_regions": [[0.25,0.10,0.60,0.95]],
    "confidence": 0.8,
    "needs_manual_review": false,
    "notes": "give gaze room to the right; keep the doorway"
  }
}}

Resume/cache is keyed on source sha256 + parameters + semantic; re-running is cheap and only the changed photos recompute.

Outputs (under --output)

PathMeaning
compose-manifest.jsoneverything: geometry, focal elements, scores, alternatives, rationale, confidence, review flags, schema
meta.jsonrun summary + honesty statement
xmp/<stem>.xmpgeometry-only XMP (photo-render applies orientation→straighten→crop)
xmp-merged/<stem>.xmponly if --merged-develop: geometry + develop tone
previews/<stem>_before.jpgEXIF-corrected original
previews/<stem>_after.jpgselected geometry
previews/<stem>_overlay.jpgcrop rectangle, horizon line, thirds grid, saliency centre
compose-report.htmlinteractive before/after + alternatives + decisions
compose-decisions.jsondecisions (from serve/export)
applied/apply-decisions output (XMP + summary)
semantic-template.jsontemplate for the multimodal pass
.state.jsonresume checkpoint

Coordinates and transform order

Normalized [0,1], origin top-left, x→right, y→down. Order: orientation → straighten → crop → downscale, matching photo-render.pipeline.render._straighten_and_crop. crs:CropAngle is clockwise degrees; crop = L,T,R,B fractions of the straightened frame.

Honesty limits

  • No pose/limb model is bundled: body detection and movement come from the semantic layer; nothing is fabricated.
  • Profile faces and very small faces may be missed (MediaPipe + Haar fallback).
  • Saliency is not semantics: a bright sky can be salient and still not be the subject.
  • No Adobe Lightroom / Capture One pixel parity claim.
  • --sample N processes the first N keepers only and is not a full-batch claim.

References

  • references/workflow.md — step-by-step operational guide and integration recipes.
  • references/manifest-schema.md — every manifest field.
  • references/semantics.md — semantic.json contract and how it is merged.
  • references/limits.md — known limits and how to verify them.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

photo-cull

Pipeline local de pré-culling fotográfico: analisa uma pasta de fotos (JPG/ARW) e detecta, automaticamente, fotos com desfoco, motion blur, sobre/subexposição, banding de LED e olhos fechados, classificando cada uma em MANTER / REVISAR / REJEITAR / INDETERMINADO; agrupa fotos duplicadas/quase-duplicadas e escolhe a melhor de cada grupo; produz um relatório HTML centrado em grupos. Usa esta skill sempre que o usuário quiser filtrar, "pre-cull", analisar qualidade, remover duplicados ou limpar um lote de fotos — por exemplo "remove fotos desfocadas", "encontrar fotos sobreexpostas", "reporte de qualidade de fotos", "culling de fotos de um evento", "limpa esta pasta de fotos ruins", "encontrar fotos com olhos fechados", "remover duplicadas" — mesmo que não diga a palavra "culling" explicitamente.

photo-develop

Local CPU-only Sony ARW develop, image review, Lightroom/Camera Raw XMP with a per-frame tone curve, previews and session report. Reuses photo-cull scores.json without repeating pre-cull.

photo-export

Local CPU-only deterministic NON-DESTRUCTIVE photo export. Chains sibling skills photo-cull -> photo-develop -> photo-render (their exact documented CLIs; no reimplementation; no invented flags), then COPIES finished sRGB rendered images into <source>/Export. Source/session folder read-only; originals never modified; no source/XMP writes; no adjacent sidecar writes; no network; no GPU; no style learning (not photo-style-edit); no retouching; applies ONLY already-present XMP via photo-render; unsupported XMP fields reported, never silently dropped; no Adobe Lightroom/Capture One/Aftershoot pixel parity; sample mode is NOT a full-pipeline claim. All intermediates go to a work dir (default <parent>.photo-export-work; never inside Export); nothing else is written into <parent>. Clear per-stage errors; missing tool / source / malformed input / no-keepers fail loudly. Optional reuse (--reuse-cull/--cull/--xmp/--no-cull/--no-develop/--no-render, <work> pre-cull + photo-ai/xmp + .state.json...

photo-render

Local CPU-only deterministic non-destructive renderer: apply EXISTING edits from matching *.xmp sidecars (exposure, white balance, contrast, highlights, shadows, whites, blacks, saturation/vibrance, tone curve, crop/rotate/ straighten, process-version aware) to source RAW (Sony .ARW) or supported images and write finished sRGB images (JPEG 92 / TIFF / PNG, full resolution or --max-long-edge). Third stage of photo-cull -> photo-develop -> photo-render. Prefers photo-develop XMP at <source-or-output>/photo-ai/xmp. Originals read-only; source XMP never overwritten; no style learning; no retouching; no network. Batch-capable; reuses photo-develop raw.py + cull_input and optional LightCraft CLI backend when present; honest applied/unsupported field reporting; no Adobe Lightroom/Capture One/Aftershoot pixel parity.

관련 스킬