A compiled script style is declarative JSON rendered by Rust, not executable Python. Operations run in array order. Invalid/unknown operations and fields are rejected; compilation can fall back to generative processing. Values are clamped to supported ranges. See recipe.rs for validation.

{
  "version": 2,
  "kind": "script",
  "brief": "Warm film with gentle contrast",
  "summary": "Warm film",
  "ops": [
    {"op": "adjust", "temperature": 25, "contrast": 12, "shadows": 15},
    {"op": "curves", "rgb": [[0, 0.06], [0.5, 0.52], [1, 0.96]]},
    {"op": "split_toning", "shadows": {"hue": 210, "sat": 0.2}, "highlights": {"hue": 40, "sat": 0.25}},
    {"op": "vignette", "amount": -0.3},
    {"op": "grain", "amount": 0.05}
  ]
}
OperationParameters
adjustexposure: −2..2 EV; contrast, highlights, shadows, temperature, tint, saturation, vibrance: −100..100
curvesrgb, r, g, b: 2..32 [x,y] points in 0..1; monotone cubic spline
split_toningshadows, highlights: {hue: 0..360, sat: 0..1}; balance: −1..1
bwmix: [r,g,b] (Rec.709 luminance by default); strength: 0..1
lutfile: a .cube file in the style directory, other than reserved style.cube; strength: 0..1
vignetteamount: −1..1 (negative darkens); radius: 0..1.5; softness
grainamount: 0..1; size: fraction of long side (default 0.0005); seed
sharpenamount: 0..5; radius_px
blurradius: sigma as a fraction of long side
crop_aspectaspect: width/height; anchor: center/top/bottom/left/right
rotatedegrees: 90/180/270 clockwise
fliph, v
resizemax_side: pixels
cropOne-off edits only: x, y, w, h as fractions in 0..1
straightenOne-off edits only: degrees −45..45 clockwise; empty corners are trimmed

The recipe ops array differs from the manual-tools --ops object, which uses keys such as adj, crop, rotate, and max_side.

Render and compare

ekphrasis style-render style.json before.jpg rendered.png --compare after.png

This hidden CLI command prints dimensions and mean difference from the optional reference. Style compilation gives Codex the command to check its recipe.

LUTs and legacy styles

Compilation can bake color operations into a 17³ .cube LUT. Spatial operations (grain, vignette, sharpening, blur, geometry) are omitted; partial LUTs are marked partial. The style screen reports how the LUT differs from the full recipe.

Legacy style.py files are no longer executed. Existing baked LUTs or generative mode can still be used; recompiling converts a style to the current recipe workflow and removes the old script. Back up a library before migrating older styles.