Skip to main content

Measuring and correcting

The instruments

cleya contrast --input out.mp4 --time 3.2
cleya align --input out.mp4 --time 3.2 --tolerance 6
cleya palette --input frame.png
cleya brand_check --input out.mp4 --time 3.2 --brand brand.json --min_score 90
cleya review --input out.mp4 --platform tiktok
cleya claims --scene promo.json --policy policy.json
cleya diff --a before.png --b after.png

All of them accept a video plus --time, or a still image directly.

contrast OCRs each text region, then splits strokes from ground with Otsu's method before computing the WCAG ratio — so it measures the text against what is actually behind it, not the average of a box.

align reports near-misses, which is the defect a human eye slides past: two headlines whose left edges differ by 7px, a stack whose vertical rhythm breaks on one row. Tolerance defaults to about 0.3% of frame width.

brand_check returns 0–100 with per-colour ΔE detail and coverage. Neutrals pass.

review is the broad sweep — black, empty and frozen frames, text collisions, unsafe margins, tiny text, audio dead-air and no-bed. --platform tiktok|reels|shorts adds the UI-occlusion zones those apps overlay.

Correcting

edit applies one op, or an array of ops, to a scene file:

cleya edit --scene promo.json --op '{"op":"center","layer":"headline"}' --verify
cleya edit --scene promo.json --op '[
{"op":"set-text","layer":"tagline","text":"in one command"},
{"op":"retime","layer":"cta","by":0.4}
]'

Ops: center, set-text, recolor, retime (shifts beats), resize, move, swap-motion.

Two guarantees:

  • Validation before write. An edit can never leave a broken scene on disk — if the result would not compile, nothing is written.
  • --verify measures. The edited scene is probe-rendered and run through align and contrast, so the change arrives with readings attached. Pass --brand when the scene uses $palette tokens.

Write the result elsewhere with --output instead of editing in place.

Why this order

Measure, then correct, then re-measure. Every one of these tools returns facts an agent can branch on — a ratio, a score, a pixel offset — rather than an opinion it has to interpret. That is the whole reason a weaker model with good instruments beats a stronger one flying blind.