Community图像github.com

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-develop 是什么?

photo-develop is a OpenCode agent skill that 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.

兼容平台~Claude Code~Codex CLI~Cursor✓OpenCode
npx skills add https://github.com/jpb18/FototecaSkills/tree/HEAD/photo-develop

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Photo develop — local, incremental session pipeline

This skill never edits source photographs. It reads the pre-cull report, Sony ARW and matching camera JPEGs; outputs are written to a separate photo-ai folder by default. No GPU, no network, no runtime model inference.

What changed, and why

The first version wrote a sidecar with almost everything at zero (exposure, shadows and highlights only, bounded to ±0.7 EV) and drew the preview with Pillow brightness on a LibRaw decode that sits 2–3 stops below what Lightroom shows. Two consequences: there was nothing to tune in the XMP, and the preview did not represent the sidecar.

The current engine measures the RAW, measures the renderer, and writes a real tone curve:

  1. Measure the RAW, not the camera JPEG: per-channel clipping, highlight headroom, shadow noise σ, LED banding, neutral-patch cast.
  2. Render an identity baseline of that frame with neutral settings using the same renderer as the export (LightCraft CPU, or the built-in LibRaw path). That baseline carries the renderer's own base look.
  3. Compute a residual tone curve from that baseline towards the target (the sibling camera JPEG, else the embedded thumbnail): a monotone 256-point percentile map in log luminance. Because it is a residual, applying it can never double-brighten.
  4. Write crs:ToneCurvePV2012 + Exposure2012 + Vibrance + adaptive Sharpness/noise reduction + a small optional Temperature/Tint trim.
  5. Blend 30% towards the lighting-moment median (same ISO bucket and same 5-minute capture window) so a burst does not flicker.
  6. Render the preview from the same sidecar with the same renderer, measure it against the target, and correct the one systematic drift (chroma) by re-rendering once. What is reviewed is what the export will produce.

Run

python "$env:USERPROFILE\.config\opencode\skills\photo-develop\scripts\run_pipeline.py" `
  --source "C:\path\to\session" `
  --cull "C:\path\to\pre-cull-report" `
  --output "C:\path\to\session\photo-ai"

--adjacent-sidecars also copies generated XMP beside its ARW for Lightroom discovery, only where no sidecar exists. .state.json fingerprints inputs and checkpoints completed frames; re-running skips unchanged work.

Flags that matter:

FlagEffect
--lightcraft-cli PATHexplicit renderer; otherwise auto-detected (LIGHTCRAFT_CLI, PATH, C:\Program Files\LightCraft)
--no-lightcraftnever call LightCraft; built-in LibRaw renderer for identity and preview
--fastskip the LightCraft identity render (decode baseline; approximate)
--no-refineskip the correction pass that re-renders when the measured preview drifts in chroma
--no-scene-groupingkeep every frame fully individual (no group blend)
--wb-trimallow a small Temperature/Tint trim from confident neutral patches (off: warm light is usually intentional)
--sample Nprocess only the first N ranked keepers
--no-previewssidecars + report only
--forceregenerate pipeline-owned outputs (never touches originals)
--profile PATHsession-specific style profile

LightCraft is invoked as lightcraft-cli render <arw> --settings <xmp> with LIGHTCRAFT_GPU=0 and LIGHTCRAFT_NO_PREFS=1, so its CPU path is forced and no user preference leaks into the render.

Output contract

photo-ai/scores.json preserves every input cull record and adds a develop object per analysed frame: settings, xmp, preview, method, rationale (exposure, curve shape, chroma ratio, noise σ, sensor clipping, white-balance decision) and estimated_delta_e. photo-ai/metadata.json carries counts, the engine version, the fidelity summary measured on the rendered previews (tone_error_mean, tone_error_max, chroma_ratio_mean) and every warning. photo-ai/report.html is a standalone searchable report with before/after previews, per-frame rationale and fidelity. photo-ai/xmp/*.xmp are Adobe Camera Raw sidecars (ToneCurvePV2012 included). .state.json is the resume checkpoint. docs/evidence/final/ holds camera-JPG / old-export / new-engine comparison rows.

ARW originals are never modified. Sidecars stay in the output folder unless --adjacent-sidecars is passed, and existing adjacent sidecars are never overwritten.

Preferences and feedback

~/.config/opencode/photo-develop/style-profile.json is the persistent profile (override per session with --profile). It never invents a style.

python "$env:USERPROFILE\.config\opencode\skills\photo-develop\scripts\update_preferences.py" `
  --feedback "C:\path\to\my-feedback.json" `
  --profile "$env:USERPROFILE\.config\opencode\photo-develop\style-profile.json"

Feedback rows are deduplicated by stable ID. Only explicit approved_settings - suggested_settings deltas are learned, and every delta is bounded. With at least 8 approved edits the profile stores a ridge regression over frame features (ISO, luminance, clipping), so the nudge is conditional on the kind of frame instead of one global average; with less history it stores the plain mean and says so. Preferences may also set curve_strength (0..1) to keep more of the renderer's own look.

Decisions and limits

Pre-cull classifications and near-duplicate groups are input evidence, not artistic truth. The runner marks the technical keeper but keeps alternates visible. Tone is matched to the camera JPEG because that is a defensible, per-session target; it is not a claim about what the photograph should express. Skin tone, expression, pose, narrative and crop still need a human or a vision agent.

The tone curve is calibrated per frame against the renderer's identity baseline. If you change renderer, re-run with --force so the curve is recomputed rather than reused: ENGINE_VERSION invalidates the state automatically, but switching between --no-lightcraft and LightCraft does not change that constant.

LightCraft renders are not Adobe Camera Raw. XMP values are standard Camera Raw fields; verify in the target Lightroom version before batch adoption. HSL, lens/profile corrections and precise composition crops are still not guessed.

CPU / GPU guarantee

Uses rawpy (LibRaw), numpy, OpenCV, Pillow and the standard library. GPU environment flags are disabled before importing image libraries; no ONNX, MediaPipe or FocalNet is loaded. --sample is recommended before a full run.

Tests

python -m unittest discover -s scripts/tests -v

Covers curve monotonicity and percentile accuracy, curve strength, exposure in linear light, neutral-settings identity, XMP round-trip (256 points), scene grouping, ridge regression, white-balance conservatism and bounds clamps.

Individual skills in this repo

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

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-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-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.

相关技能