Skip to content

feat(svg): shrink and accelerate animated output - #24

Open
balcsida wants to merge 90 commits into
MrMarble:mainfrom
balcsida:feat/svg-optimization
Open

feat(svg): shrink and accelerate animated output#24
balcsida wants to merge 90 commits into
MrMarble:mainfrom
balcsida:feat/svg-optimization

Conversation

@balcsida

@balcsida balcsida commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • reduce animated SVG size and rendering work with buffered streaming, compact timelines, merged backgrounds, and reuse of repeated rows and cell spans
  • add opt-in frame/band/auto layouts, CSS/SMIL animation, animated href switching, and maximum-FPS sampling while keeping existing defaults lossless
  • preserve cursor-only frames, underlined whitespace, timeline boundaries, and legacy idle-cap floating-point behavior
  • add renderer benchmarks, SVG metrics, a layout comparison tool, and drift checks
  • regenerate every example with its smallest measured profile, totaling 656,581 bytes

Impact

Default exports retain their existing lossless behavior. Experimental modes allow callers to trade compatibility or temporal resolution for smaller output; the checked-in 30 FPS examples intentionally use temporal sampling.

Validation

  • go test -race ./...
  • go vet ./...
  • go build ./cmd/termsvg
  • xmllint --noout examples/*.svg
  • byte-for-byte regeneration of all six example SVGs
  • git diff --check

Demo in Safari 26.6

original.mov
optimised.mov

balcsida added 30 commits August 2, 2026 23:42
@balcsida
balcsida marked this pull request as draft August 5, 2026 20:53
@MrMarble

MrMarble commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Wow quite the contribution! Thanks!
I'll review the changes

@balcsida

balcsida commented Aug 6, 2026

Copy link
Copy Markdown
Author

I put it back to draft as there is a few things that I would like to try out before giving up to squeeze more performance and/or smaller output filesizes out

@balcsida
balcsida marked this pull request as ready for review August 11, 2026 17:12
@balcsida

Copy link
Copy Markdown
Author

Thanks for the patience, @MrMarble, could you please check this now?

@MrMarble

Copy link
Copy Markdown
Owner

Thanks for the patience, @MrMarble, could you please check this now?

Currently spending time with the family, won't have a computer until next week, but it looks promising!
Thanks a lot!

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.

3 participants