Technique · Image sequence

Apple-style scroll animation templates, built on an image sequence

The scroll effect made famous by Apple product pages is not a video playing. It is a numbered set of still frames drawn on a canvas, and the scroll position picks which one you see. Kestra and Orbitly are built exactly this way, with 443 and 691 frames, plus the scripts to swap in your own footage.

Templates built this way (2)

How it works

Under the hood.

SC.01

Scroll position picks a frame

Export a clip as numbered stills, preload them, and on every scroll update map progress (0 to 1) to a frame index and draw that image to a <canvas>. No decoding of compressed video happens while scrolling: each frame is already a complete image, so the browser only has to paint it. That is why the result stays frame-accurate forwards and backwards.

sequence.tsts
const FRAME_COUNT = 443;
const frameUrl = (i: number) => `/frames/frame_${String(i + 1).padStart(4, '0')}.webp`;

const canvas = document.querySelector<HTMLCanvasElement>('#hero-canvas')!;
const ctx = canvas.getContext('2d')!;
const frames: HTMLImageElement[] = Array.from({ length: FRAME_COUNT }, (_, i) => {
  const img = new Image();
  img.src = frameUrl(i);
  return img;
});

let lastDrawn = -1;
export function drawProgress(progress: number) {
  const index = Math.min(FRAME_COUNT - 1, Math.round(progress * (FRAME_COUNT - 1)));
  const img = frames[index];
  if (index === lastDrawn || !img.complete || img.naturalWidth === 0) return;
  ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
  lastDrawn = index;
}

Call drawProgress from a scroll-driven update, for example a GSAP ScrollTrigger onUpdate callback, whose self.progress is already the 0 to 1 value you need. A production version also draws the nearest loaded frame when the exact one is not ready yet, and sizes the canvas to the device pixel ratio.

SC.02

Loading: two frame tiers and a memory budget

Preloading hundreds of full-size frames before the page can scroll is the classic mistake. Both templates use two tiers instead: light preview frames load first so the story can scroll early, then HD frames stream in around the current scroll position. Kestra releases far frames from memory as well.

The reason is decoded size. A canvas draws decoded pixels, at four bytes each. One 1920 × 1072 frame (Kestra's HD size) is 1920 × 1072 × 4 = about 8.2 MB once decoded. Keeping all 443 decoded at once would be an estimated 3.6 GB, far more than a phone will give a tab. A sliding window of HD frames around the playhead keeps memory bounded whatever the frame count.

TierPurposeWhen it loads
PreviewSmall, heavily compressed; makes the whole story scrubbableFirst, before any HD frame
HDSharp 1920-wide frames for the current shotNearest the scroll position, streamed
Portrait (9:16)Separate crop for phones, so the subject stays in frameInstead of landscape on narrow screens

HTMLImageElement.decode() returns a promise that resolves once an image is ready to use, which lets you decode HD frames ahead of the playhead instead of during a scroll. Use the frame budget calculator to size a sequence before you export it.

SC.03

From footage to frames

The frames come from a continuous clip. Kestra's 443 frames come from two 4K Kling 3.0 clips; Orbitly ships Seedance video prompts for generating your own. Both include ffmpeg scripts that join clips and extract every frame tier. The core of that step is one command:

Terminalbash
mkdir -p frames
ffmpeg -i input.mp4 -vf "fps=24,scale=1920:-2" -c:v libwebp -quality 80 frames/frame_%04d.webp

fps sets how many frames you keep per second of footage, scale=1920:-2 sets the width and keeps the height even, and -quality trades file size against sharpness. The full walk-through, including AVIF and portrait crops, is in the guide to converting video to an image sequence with ffmpeg, or use the in-browser video to frames tool.

SC.04

Layering live graphics over the frames

Footage alone is fixed. Both templates add a real-time layer on top that reads the same scroll progress. Kestra runs a WebGL shader that turns the footage into an ink drawing which develops into real footage as you scroll, with callouts pinned to the scene. Orbitly draws a three.js light layer that changes per chapter: stars and orbit rings in space, re-entry streaks that speed up with scroll velocity, map pins over the city. Its glows only brighten the footage, so the photographed scene stays intact.

This hybrid is what keeps an image sequence from feeling like a video embed. More on the live side on the three.js templates page.

When to use it

Right for the job, or not.

You want photoreal camera moves

Drone flights, construction time-lapses and falls from orbit are cheap to generate as AI video and very expensive to render live. Frames give you that realism with exact scroll control.

The story must reverse cleanly

Every frame is a complete still, so scrolling back is as smooth as scrolling forward. A compressed video often stutters on reverse seeking.

Your audience is mostly on decent connections

Even with preview tiers, hundreds of frames are real bytes. Budget the total and check it on a throttled mobile profile before launch.

Not when the visitor should interact with the scene

Frames are baked. If people need to rotate a product, hover parts or change colours, use real-time 3D instead.

Not for a short loop

A five-second ambient background does not need scrubbing. A muted, looping video is lighter and simpler.

FAQ

Questions, answered.

The questions people ask most about this topic.

01How does the Apple scroll animation work?

It draws a sequence of still images on a canvas and chooses the frame from the scroll position. Scrolling forward advances the frames and scrolling back reverses them, with no video playing.

02Why use images instead of scrubbing a video?

Seeking a compressed video means decoding from the nearest keyframe, which can lag, especially in reverse. Pre-decoded stills draw immediately and stay frame-accurate in both directions.

03How many frames do I need?

Enough that consecutive frames look continuous at the scroll speed you design for. Kestra uses 443 frames and Orbitly 691. More frames mean more bytes, so balance smoothness against page weight.

04What image format should the frames be?

WebP is a good default for size and support. AVIF can be smaller but encodes slower. Keep a light preview tier and a sharper HD tier rather than one compromise.

05Does it work on phones?

Yes. Kestra and Orbitly both ship dedicated 9:16 portrait frames for phones and stream HD frames near the scroll position, so memory and bandwidth stay bounded.

Start from a finished scroll story.