photo-render — finished images from existing non-destructive edits
Minimal pipeline: photo-cull → photo-develop → photo-render. This skill is
the last stage. It does not invent edits, does not learn/apply styles
(that's photo-style-edit, not implemented here), does not retouch, does
not touch source files, and does not use the network. CPU-only.
It reads source RAW (e.g. Sony .ARW, also DNG/CR2/CR3/NEF/RAF/ORF/… via
rawpy/LibRaw) or supported images (JPEG/PNG/TIFF/BMP/GIF/WEBP) plus a matching
non-destructive *.xmp, applies ONLY already-present edits, and writes
finished images. photo-render itself creates no style profiles.
Run
python "$env:USERPROFILE\.config\opencode\skills\photo-render\scripts\run_pipeline.py" `
--source "C:\path\to\session" `
--output "C:\path\to\session\photo-render" `
--cull "C:\path\to\session\pre-cull-report" ` # photo-cull scores.json (or photo-develop photo-ai)
--xmp "C:\path\to\session\photo-ai\xmp" ` # photo-develop XMPs; optional
--sample 2
Windows/PowerShell paths with backslashes and spaces are supported; quote paths. Reuse photo-cull + photo-develop first if you want keepers + suggested edits:
# 1) photo-cull -> pre-cull-report/scores.json
# 2) photo-develop -> photo-ai/xmp/*.xmp (+ previews, report)
# 3) photo-render (this skill)
python ...\photo-render\scripts\run_pipeline.py `
--source "C:\path\to\session" --cull "C:\path\to\session\pre-cull-report" `
--xmp "C:\path\to\session\photo-ai\xmp" --output "C:\path\to\session\photo-render"
Options
--source DIR(required, read-only) ·--output DIR(default<source>/photo-render)--cull DIR|FILEreuse photo-cullscores.json(or photo-develop enrichedphoto-ai/scores.json): renders keepers (is_keeper==true, stable input order); matching source preferred as RAW (stem match) else the listed image--xmp FILE|DIRexplicit sidecar or folder of*.xmp;<stem>.xmpmatched--sample Nrender first N keepers/images — sample mode is NOT a full-pipeline success claim (status:"sample",full_pipeline_claim:false)--format jpeg|tiff|png(defaultjpeg) ·--jpeg-quality 1..100(default 92)--color-space sRGB(only sRGB; default sRGB, static sRGB ICC embedded)--max-long-edge Ndownscale long edge; full resolution by default; never upscale--recursivescan--sourcerecursively (bounded; prunes node_modules/.git/ dist/build/.next/target/vendor/.venv/pycache/output dirs; no symlinks; depth + file caps)--keep-pairsrender BOTH halves of RAW+JPEG same-stem pairs (default renders once per stem preferring RAW)--emit-xmpcopy applied source XMP verbatim to<output>/rendered-xmp/(only when passed; never overwrites source XMP/source images)--require-xmprender only sources with a matching XMP sidecar; the rest are recorded asskippedinsummary.json(counts skipped separately fromerror, and a skip does not change the exit code).photo-exportturns this on whenever a develop stage ran, so frames the develop stage deliberately left without a sidecar are never exported with default settings.--renderer auto|builtin|lightcraft(defaultauto: LightCraft CLI if present, else builtin) ·--lightcraft-cli PATH(orLIGHTCRAFT_CLIenv)
XMP discovery (per image, in order; never writes source XMP)
--xmp FILE, or<stem>.xmpinside--xmp DIR- photo-develop output preferred:
<source>/photo-ai/xmp/<stem>.xmp,<output>/photo-ai/xmp/<stem>.xmp(case-insensitive) - adjacent sidecar next to source (
<stem>.xmp,<name>.xmp,<name>.xmpvariants, case-insensitive) - none → render source unchanged (reported, not silently)
What is applied (and what is NOT)
applied_fields per image + aggregate lists every XMP field read & applied;
unsupported_fields lists every other rendering field present — nothing is
silently ignored. Known metadata (e.g. crs:AlreadyApplied, crs:HasSettings,
xmp:Rating, xmp:Label, XMP history) is echoed as known_non_rendering_fields.
Apply-existing-only; crs:AlreadyApplied is read & reported; sources are
assumed un-rendered originals.
Applied (builtin): crs:Exposure2012/crs:Exposure, crs:WhiteBalance,
crs:Temperature, crs:Tint, crs:Contrast2012/crs:Contrast,
crs:Highlights2012, crs:Shadows2012/crs:Shadows, crs:Whites2012,
crs:Blacks2012, crs:Saturation, crs:Vibrance, crs:ToneCurveName2012,
crs:ToneCurvePV2012 + …Red/Green/Blue, legacy crs:ToneCurve + …Red/Green/Blue,
crs:HasCrop, crs:CropTop/Left/Bottom/Right, crs:CropAngle,
crs:Orientation, tiff:Orientation, crs:ProcessVersion (PV2012 11.0+
uses *2012 fields; older versions use legacy names). Crop/rotate/straighten
applied; orientation applied; downscale after geometry.
Process-version awareness: read crs:ProcessVersion; PV2012 vs legacy
field naming handled; nothing else assumed about profile versions.
Not applied (honestly reported unsupported when present): crs:CameraProfile
(Adobe/camera profile not reproduced), crs:CropConstrainToWarp, HSL mixer,
split toning, color grading, crs:Clarity2012/crs:Texture/crs:Sharpness/
crs:LuminanceSmoothing/crs:ColorNoiseReduction (in builtin mode; see
LightCraft note), lens/optics/vignette corrections, grain, dehaze, local
adjustments/masks, retouching, spot removal, snapshots/history, any unknown
field. Adobe built-in named curves (e.g. ToneCurveName2012="Medium Contrast")
WITHOUT explicit points are not synthesized.
LightCraft backend (--renderer lightcraft, auto when found): reuse
lightcraft-cli render (sibling photo-develop uses the same backend); GPU
disabled (LIGHTCRAFT_GPU=0, LIGHTCRAFT_NO_PREFS=1); sRGB; --size/--quality;
applies its own supported superset. Additionally applies (forwarded in XMP,
reported applied only in this mode; still NOT Adobe parity):
crs:Clarity2012, crs:Texture, crs:Sharpness, crs:LuminanceSmoothing,
crs:ColorNoiseReduction. Falls back to builtin (recorded in per-image
notes) if LightCraft fails; renderer field says what was used. If LightCraft
is absent, --renderer lightcraft gives a clear error; auto uses builtin.
Renderer backend
builtin(always available; fully deterministic; no external deps beyond the reused local rawpy/Pillow/numpy stack): RAW decoded with photo-developpipeline.raw.decode_image(reused; rawpy/LibRaw, camera WB, sRGB, no-auto-bright, full res); supported images via Pillow + EXIF orientation. Applies the documented subset above. Smallest honest renderer subset; approximations (white balance blackbody, contrast pivot, tone-region smoothstep curves, chroma scaling, straightening fill, crop geometry) are documented; NOT Adobe-exact.lightcraft: external proprietary CLI; LightCraft renders a lossless full-res sRGB intermediate which photo-render re-encodes deterministically (own format/quality/max-long-edge, static sRGB ICC, no metadata/timestamps); NOT Adobe.- No Adobe Lightroom / Capture One / Aftershoot pixel-parity claim. Validate in your editor before batch adoption.
Outputs (under --output; originals untouched)
<output>/rendered/finished images, sRGB, batch; default JPEG q92 / TIFF-LZW / PNG; static sRGB ICC; deterministic encoder; no timestamps/metadata; full res unless--max-long-edge<output>/logs/<stem>.jsonper-image log:applied_fields,unsupported_fields,known_non_rendering_fields,source,xmp,output,renderer,status,error,edits,notes,emitted_xmp?<output>/summary.jsontotals,status,claim,sample_mode,full_pipeline_claim,renderer,applied_fields,unsupported_fields,unsupported_field_counts, counts,images[], honesty note<output>/report.htmlstandalone report (thumbnails, applied/unsupported, errors)<output>/rendered-xmp/verbatim XMP copies — only when--emit-xmp
Reuse (not reimplemented)
photo-develop scripts/pipeline/raw.py (decode_image, …), cull_input.py
(select_photos keepers), config.py conventions (JPEG_EXT, RAW_EXT,
photo-ai, xmp, CPU env, LIGHTCRAFT_*), XMP namespace conventions +
crs: schema it writes; sibling photo-cull schema (scores.json keepers,
file, is_keeper, category); optional LightCraft CLI (--lightcraft-cli;
auto-discovered at C:\Program Files\LightCraft\lightcraft-cli.exe,
C:\Program Files (x86)\LightCraft\..., PATH, LIGHTCRAFT_CLI). photo-develop
xmp.py does not exist in this install; pipeline/xmp_apply.py implements
reading (it writes nothing to source). photo-develop style-profile /
learned adjustments are deliberately NOT read. photo-cull photo-ai /
pre-cull-report consumed read-only.
Determinism, safety, limits
- Deterministic: stable ordering, sorted JSON keys, fixed encoder, static sRGB ICC, no timestamps, no randomness, no network, CPU-only (GPU disabled).
- Non-destructive: source RAW/JPEG/PNG/TIFF bytes and source
*.xmpare only read; outputs only under--output;rendered-xmpcopies are new files; nothing is deleted; no--force; never writes adjacent to sources. - Bounded scans; clear errors; per-image errors don't abort the batch (exit 0 all-ok / 2 any-error / 1 fatal). Unsupported fields reported.
- Remaining limits: no Adobe pixel parity; white balance is a documented
approximation (As-Shot/0/0 from photo-develop is a no-op; custom numeric WB
approximate); tone-region & contrast curves approximate; crop geometry
approximate (straightening fills exposed corners; Adobe crop units not
fully replicated); named curves without points not synthesized;
crs:CameraProfile/profile corrections/lens corrections/local adjustments/masks/noise+sharpen (builtin) not applied; LightCraft-only extras apply only in LightCraft mode;AlreadyAppliedsemantics noted not re-derived (pristine source assumed); EXIF-only edits not applied; builtin color management is sRGB in→sRGB out (no ICC transformation of embedded source profiles); LightCraft pixel output is re-encoded by photo-render (observed byte-deterministic here, but that depends on the installed backend); RAW decode determinism depends on the installed rawpy/LibRaw version. No style learning. No retouching. No network.
Tests
python "$env:USERPROFILE\.config\opencode\skills\photo-render\scripts\tests\test_smoke.py"
# or: python -m unittest discover -s "$env:USERPROFILE\.config\opencode\skills\photo-render\scripts\tests" -v
Stdlib unittest, no network, no LightCraft required (builtin path), synthetic
images + XMPs; covers XMP parsing, process versions, curves, applied/unsupported
honesty, discovery precedence, formats, crop, exposure, saturation, sample mode,
keeper reuse, no-source-mutation, emit-xmp safety, clear errors.