Skip to content

perf: inline html5 images at the size a scaled bake draws them - #268

Merged
dazzatronus merged 1 commit into
mainfrom
derk/html5-bake-rendition-size
Oct 28, 2026
Merged

dazzatronus merged 1 commit into
mainfrom
derk/html5-bake-rendition-size

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

A scaled bake inlined ingest images sized for the clip's full output, and every frame's SVG decodes its inlined images again. A 1080p clip baked at half size asked for the 2048 rendition, which ingest doesn't make for a source under 2048 px, so it fell back to the original. In the edit below, that put a 747 KB JPEG into every frame when the 163 KB 1024 rendition was enough.

The bake now passes its scale to the inliner. Stills keep full-size images, because exports read them.

Measured on an edit with 15 html5 clips (4,515 frames at 30 fps), six of which share one photo, in headless desktop Chrome with the GPU. The time from opening the edit until playback is ready went from 117 s to 95 s.

Verify: npx jest tests/html5-player.test.ts -t "inlines ingest files sized". Then open an html5 clip whose CSS uses an ingested image, in a preview smaller than the output. The bake should fetch html5-1024.webp, not source.*.

Risk: low. An image drawn larger than its clip (a zoomed background) is as soft relative to the frame as a full-size bake already makes it.

@dazzatronus
dazzatronus merged commit 6555fd7 into main Oct 28, 2026
1 check passed
@dazzatronus
dazzatronus deleted the derk/html5-bake-rendition-size branch October 28, 2026 03:58
github-actions Bot pushed a commit that referenced this pull request Oct 28, 2026
## [2.29.5](v2.29.4...v2.29.5) (2026-10-28)

### Performance Improvements

* draw each frame of a looping html5 page once ([#269](#269)) ([63e4ee7](63e4ee7))
* inline html5 images at the size a scaled bake draws them ([#268](#268)) ([6555fd7](6555fd7))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.29.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant