Skip to content

Place moving pictures to a fraction of a pixel, so zooms and slides don't jitter - #6

Merged
calvin-archastro merged 1 commit into
mainfrom
fix/smooth-animated-motion
Oct 22, 2026
Merged

calvin-archastro merged 1 commit into
mainfrom
fix/smooth-animated-motion

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

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:

Method Frame-to-frame change
before swings between 0.01 and 2.32 (stalls, then jumps)
after steady, 1.14–1.65

Tests

  • New a_moving_picture_is_placed_to_a_fraction_of_a_pixel.
  • cargo test --workspace and cargo clippy --workspace --all-targets -D warnings pass.

🤖 Generated with Claude Code

…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>
@calvin-archastro
calvin-archastro merged commit 1b2ef7a into main Oct 22, 2026
6 checks passed
@calvin-archastro
calvin-archastro deleted the fix/smooth-animated-motion branch October 22, 2026 02:27
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