remotion: Add posterize option to interpolation APIs - #7830
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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— AddedposterizetoInterpolateOptions, anassertValidInterpolatePosterizeOptionguard, andMath.floor(input / n) * nquantization before range selection and interpolation.packages/animation-utils— WiredposterizethroughinterpolateStyles()using the same quantization formula.packages/core/src/interpolate-keyframed-status.ts— Applied frame quantization before dispatching tointerpolate()orinterpolateColors()for Studio-keyframed props.packages/studio-server— Parsedposterizefrom the AST options object ingetInterpolationMetadata; returnscomputedfor non-literal expressions.packages/docs— Documented the new option with an example and updatedAvailableFromto4.0.470.- Tests — Added unit tests for runtime behavior, validation, and keyframe-prop parsing.
Kimi K2 | 𝕏
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
remotion: Add posterize option to interpolateremotion: Add posterize option to interpolation APIs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
posterizeoption tointerpolate()that floors the input to fixed-size steps before interpolation.posterizethrough Visual Mode keyframe metadata and interpolation.interpolateStyles()because it acceptsInterpolateOptions.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.tsbun run buildbun run formattingbun run stylecheckbun run build-docs