Skip to content

remotion: Add posterize option to interpolation APIs - #7830

Merged
JonnyBurger merged 2 commits into
mainfrom
jonnyburger/posterize-interpolate
May 30, 2026
Merged

remotion: Add posterize option to interpolation APIs#7830
JonnyBurger merged 2 commits into
mainfrom
jonnyburger/posterize-interpolate

Conversation

@JonnyBurger

Copy link
Copy Markdown
Member

Summary

  • Add a posterize option to interpolate() that floors the input to fixed-size steps before interpolation.
  • Carry posterize through Visual Mode keyframe metadata and interpolation.
  • Apply the same option to interpolateStyles() because it accepts InterpolateOptions.
  • Document the new option and add tests for runtime behavior, validation, and keyframe parsing.

Fixes #7790

Test plan

  • bun test packages/core/src/test/interpolate.test.ts packages/core/src/test/interpolate-keyframed-status.test.ts packages/studio-server/src/test/compute-sequence-props-status.test.ts packages/animation-utils/src/test/interpolate-styles.test.ts
  • bun run build
  • bun run formatting
  • bun run stylecheck
  • bun run build-docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment May 30, 2026 8:24am
remotion Ready Ready Preview, Comment May 30, 2026 8:24am

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed changes — Added posterize option to interpolate(), interpolateStyles(), and the Studio’s keyframe prop-status pipeline. The feature quantizes the input before interpolation so animations update in discrete steps rather than every frame.

  • packages/core/src/interpolate.ts — Added posterize to InterpolateOptions, an assertValidInterpolatePosterizeOption guard, and Math.floor(input / n) * n quantization before range selection and interpolation.
  • packages/animation-utils — Wired posterize through interpolateStyles() using the same quantization formula.
  • packages/core/src/interpolate-keyframed-status.ts — Applied frame quantization before dispatching to interpolate() or interpolateColors() for Studio-keyframed props.
  • packages/studio-server — Parsed posterize from the AST options object in getInterpolationMetadata; returns computed for non-literal expressions.
  • packages/docs — Documented the new option with an example and updated AvailableFrom to 4.0.470.
  • Tests — Added unit tests for runtime behavior, validation, and keyframe-prop parsing.

Pullfrog  | View workflow run | Using Kimi K2𝕏

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JonnyBurger JonnyBurger changed the title remotion: Add posterize option to interpolate remotion: Add posterize option to interpolation APIs May 30, 2026
@JonnyBurger
JonnyBurger merged commit 6e893dc into main May 30, 2026
18 checks passed
@JonnyBurger
JonnyBurger deleted the jonnyburger/posterize-interpolate branch May 30, 2026 09:09
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.

Add posterize option to interpolate() for stepped/sampled animations

1 participant