Sony RAW Styled JPEG
Use one of two workflows:
exact: deterministic one-pass RAW -> styled JPEG conversion with fixed style buckets.profiled:profile -> bucket -> render -> validatefor mixed batches or iterative feedback.
Core Idea (First Principles)
- RAW decode quality is foundational: a bad decode cannot be fixed later.
- Profile before transform when the batch is heterogeneous.
- Separate technical correction from optional mood or taste layers.
- Work by cohorts, not by one batch-wide grade.
- EXIF is part of the asset and must be preserved.
- Validation is mandatory: trust output only after metadata checks pass.
Bundled Files
scripts/raw_to_styled_jpeg.swift: Core converter and style engine.scripts/profile_raw_images.swift: Batch profiler that groups RAWs into treatment buckets.scripts/render_profiled_batch.swift: Profile-driven renderer with optional subtle mood modes.scripts/verify_datetime_original.swift: EXIF timestamp validator.scripts/run_exact_pipeline.sh: Deterministic compile -> convert -> validate.scripts/run_profiled_pipeline.sh: Profile -> render -> validate workflow.scripts/run_interactive_pipeline.sh: Prompt-driven workflow chooser.references/PIPELINE_FIRST_PRINCIPLES.md: Visual, simple-language guide with ASCII diagrams.references/ADAPTIVE_BATCH_WORKFLOW.md: General-purpose profile/bucket/transform/validate playbook.
Choose Workflow
Use exact when:
- The user wants strict reproducibility.
- The batch is fairly uniform.
- You want the original fixed style buckets with no iterative mood layer.
Use profiled when:
- The batch mixes bright sky, dark woods, overcast scenes, close details, and different tonal problems.
- The user gives qualitative feedback like "too blue", "too bright", or "make some of them moodier".
- You need to separate technical fixes from a later artistic pass.
Read references/ADAPTIVE_BATCH_WORKFLOW.md when you need to reason about feedback loops, subgroup creation, or future reuse of the workflow outside this specific image set.
Required User Prompts (Interactive)
Before starting conversion, ask:
- Input folder path containing
.ARWfiles. - Output folder name inside that input folder.
- Scope: full batch (
all) or sample (sample). - If sample: number of files (
N). - Workflow mode:
exactorprofiled. - If profiled: mood layer
noneorsubtle. - If output folder already exists: preserve it first or stop.
- Whether to print representative output image paths.
Defaults if user does not specify:
- Input folder: current working directory.
- Output folder:
codex_output. - Scope:
all. - Sample size:
24. - Workflow mode:
profiledfor mixed batches, otherwiseexact. - Mood layer:
none. - Preserve existing output:
yes. - Preview paths:
yes. - EXIF preservation: always
yes.
Commands
Exact deterministic run:
bash scripts/run_exact_pipeline.sh . codex_output
Profiled technical run:
bash scripts/run_profiled_pipeline.sh . codex_output none
Profiled run with subtle mood layer:
bash scripts/run_profiled_pipeline.sh . codex_output subtle
Interactive run:
bash scripts/run_interactive_pipeline.sh
When installed in Codex at user scope, an absolute invocation is also valid:
bash "${CODEX_HOME:-$HOME/.codex}/skills/sony-raw-styled-jpeg/scripts/run_exact_pipeline.sh" . codex_outputbash "${CODEX_HOME:-$HOME/.codex}/skills/sony-raw-styled-jpeg/scripts/run_profiled_pipeline.sh" . codex_output none
Non-Negotiable Settings
- Compile with Swift module cache at
/tmp/swift-module-cache. - Keep the exact pipeline thresholds unchanged when using
run_exact_pipeline.sh. - Export JPEGs with lossy quality
1.0. - Preserve source metadata payload in every output JPEG.
- Require EXIF validator
RESULT: PASS.
Output Contract
Always report:
- Number of source
.ARWfiles discovered. - Number of output
.jpgfiles written. - For
exact: style distribution fromstyle_report.csv. - For
profiled: treatment distribution fromprofiled_style_report.csv. - For
profiled: profile summary path fromprofiling/raw_profile_summary.txt. - If a mood layer was used: the mood preset and any per-file mood modes that were applied.
- EXIF validation pass/fail and mismatch counts.
- 1-3 output image paths if preview was requested.
Operational Note
If rerunning after review, preserve or rename the previous output directory before writing a new batch. If RAW decode fails or output dimensions are invalid in restricted environments, rerun with permissions that allow full CoreImage RAW decode path.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.