Skip to content

fix(engine): lower default CRF for better gradient rendering#216

Closed
miguel-heygen wants to merge 1 commit intomainfrom
fix/encoder-quality-crf
Closed

fix(engine): lower default CRF for better gradient rendering#216
miguel-heygen wants to merge 1 commit intomainfrom
fix/encoder-quality-crf

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Apr 7, 2026

Summary

  • Standard preset CRF 23→18, high preset CRF 18→15
  • Reduces H.264 quantization artifacts on subtle gradients

What it targets

Eval prompts 3, 5, 10, 14 all noted "color banding" on dark gradient backgrounds. Lower CRF preserves more color precision in smooth gradient regions.

Honest assessment

After testing: the CRF reduction provides marginal improvement for dark gradient banding. The visual difference between CRF 23 and 18 is subtle — most of the banding visible in the eval videos comes from the 8-bit color depth of yuv420p, which CRF alone can't fix.

The higher-impact fix is PR #217 (skill guardrails), which tells agents to avoid full-screen dark linear gradients entirely and use radial gradients or solid backgrounds with localized glows instead.

This PR still has value as a general quality bump — CRF 18 is more appropriate for a video rendering tool where output quality matters more than file size.

Trade-off

~30-50% larger file sizes for standard/high quality.

Test plan

  • pnpm --filter @hyperframes/engine test — all 26 tests pass
  • Synthetic gradient comparison (CRF 23 vs 18) — marginal visual difference confirmed
  • File size comparison — within expected range

🤖 Generated with Claude Code

Standard preset CRF 23→18, high preset CRF 18→15. The previous
CRF values produced visible color banding on dark gradient
backgrounds — a recurring issue in eval (prompts 3, 5, 10, 14
all flagged gradient banding). Lower CRF increases file size
but eliminates the banding that made otherwise-good compositions
look unprofessional.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguel-heygen
Copy link
Copy Markdown
Collaborator Author

Removing from stack — CRF change provides marginal improvement. The real fix for gradient banding is the skill guardrail in PR #217.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant