# Color grading — grade blocks and LUTs Use `grade` when you need the actual HyperFrames `data-color-grading` value to paste onto an `` or ``. Core presets and params-backed library looks resolve locally; future CDN-backed library looks require network unless already frozen: **Never `cat`/read a `.cube` file into context.** A 3D LUT is ~size^3 lines of raw numbers (33^3 ≈ 36k lines at the default size). It bloats context and carries zero human/agent-legible signal. To understand or choose a LUT, use `hyperframes grade-compare` to see it rendered, or `cube-validate.mjs` for a one-line `{ok,size}` check. Read `.media/index.md` or `luts/index.json` for the description. Never read the LUT body itself. ```bash node /scripts/resolve.mjs --type grade --intent "warm daylight" --project . --json ``` Preset-first output uses the core runtime vocabulary and does not freeze a file: ```json { "preset": "warm-daylight", "intensity": 1 } ``` Paste it as an attribute value after JSON string escaping: ```html ``` Looks beyond the preset vocabulary freeze a validated `.cube` under `.media/luts/` and return a block that references it: ```bash node /scripts/resolve.mjs --type grade --intent "teal orange blockbuster" --project . --json ``` ```json { "intensity": 1, "lut": { "src": ".media/luts/grade_001.cube", "intensity": 0.85 } } ``` Use `lut` when you only need the reusable `.cube` file: ```bash node /scripts/resolve.mjs --type lut --intent "teal orange blockbuster" --project . ``` For a describable technical look, author an explicit parametric LUT with `--params`: ```bash node /scripts/resolve.mjs --type lut --params '{"contrast":0.2,"temperature":-0.3}' --project . node /scripts/resolve.mjs --type grade --params '{"exposure":0.2}' --project . --json ``` For a LUT generated by your own script, ingest it with `--from`; media-use validates it before registration and rejects invalid or oversized cubes: ```bash node /scripts/resolve.mjs --type lut --from custom.cube --project . ``` Parametric math (`buildCube`) cannot reproduce real film stocks or emulsion looks. Use a CDN-backed scanned `.cube` entry or ingest a real scanned `.cube` for those. For visual selection, list reusable looks with `resolve --type grade --candidates`, write the promising entries to a `grades.json`, run `hyperframes grade-compare --for --grades grades.json`, then commit the winner with `resolve -t grade` as the final `data-color-grading` block. Smart grade is `grade --for `. It runs local `ffmpeg`/`ffprobe` signalstats, merges a bounded `adjust` suggestion into the returned block, and prints the measured evidence to stderr. Stdout remains valid JSON under `--json`; the suggestion is a starting point for the agent to tune, not an automatic neutralization of intentional color. ```bash node /scripts/resolve.mjs --type grade --intent "warm cinematic" --for ./frame.png --project . --json ``` Library looks live in `luts/index.json`. Each entry keeps `id`, `description`, `tags`, and `intensity`, then supplies either compact `params` for on-demand `buildCube(params)` generation or a direct CDN `url` for future scanned `.cube` files. Do not commit generated `.cube` bodies; resolve validates generated or downloaded cubes as it freezes them under `.media/luts/`. ```bash node skills/media-use/scripts/resolve.mjs --type lut --intent "teal orange blockbuster" --project . --json node skills/media-use/scripts/lib/cube-validate.mjs .media/luts/lut_001.cube ```