Repository navigation
Place moving pictures to a fraction of a pixel, so zooms and slides don't jitter - #6
Merged
Merged
Conversation
…on't jitter Export resized an animated clip every frame (scale ... eval=frame), which rounds its size to whole even pixels, and overlaid it at a whole-pixel position centred on that rounded size. A slow drift zoom therefore stepped in size and wobbled about a pixel from frame to frame; slides stuttered. A moving clip now keeps one size, sits in a see-through frame of the canvas, and is placed each frame with perspective (cubic, sub-pixel) from the same pose expressions. On a 5 s drift the frame-to-frame change goes from swinging between 0.01 and 2.3 to a steady 1.1 to 1.7. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Problem
Export resized an animated clip every frame (
scale=…:eval=frame), which rounds its size to whole even pixels (trunc(…/2)*2). It then overlaid the clip at a whole-pixel position centred on that rounded size. So a slow drift zoom stepped in size and wobbled by about a pixel from frame to frame, and slide entrances stuttered.Fix
A moving clip now keeps one size: it's scaled once to its natural size and padded into a see-through frame the size of the canvas. Each frame it is placed by
perspective(cubic, sub-pixel,eval=frame), using the same pose expressions as before. Time comes from the frame count (in/fps) plus the clip offset. The overlay is then at a fixed position. Clips that don't move are unchanged.Evidence
On a 5 s 15% drift over a still:
Tests
a_moving_picture_is_placed_to_a_fraction_of_a_pixel.cargo test --workspaceandcargo clippy --workspace --all-targets -D warningspass.🤖 Generated with Claude Code