Skip to content

feat: support webp as a first-class output format#764

Open
alsi-lawr wants to merge 2 commits into
charmbracelet:mainfrom
alsi-lawr:main
Open

feat: support webp as a first-class output format#764
alsi-lawr wants to merge 2 commits into
charmbracelet:mainfrom
alsi-lawr:main

Conversation

@alsi-lawr

Copy link
Copy Markdown

Closes #50
Supersedes #60

Summary

Adds animated WebP output support:

Output out.webp

Uses:

-vcodec libwebp_anim
-pix_fmt yuva420p
-quality 100
-compression_level 3
-lossless 0
-loop 0
-an

WebP output is significantly smaller than equivalent GIFs while preserving animation and alpha (used for rounded corners).

Fixes vs #60

  • Uses libwebp_anim (correct encoder for animation)
  • Uses -quality instead of unused -crf
  • Removes -b:v 0 (not meaningful for WebP)
  • Uses yuva420p to preserve alpha
  • Adds -compression_level to control encode time

Verification

Built locally and rendered from the same tape:

Output webp-smoke.gif
Output webp-smoke.webp

Confirmed:

  • WebP renders and loops correctly
  • Alpha works (rounded corners preserved)
  • Timing matches GIF/WebM
  • File size is much smaller than GIF
  • Existing GIF/WebM outputs unchanged

WebP output (~19.2 KiB) vs GIF (~24.8 KiB) from the same recording.

Note

I've also migrated neofetch -> fastfetch because neofetch is dead. The good news is that now the fastfetch tape is more reproducible.

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.

Add WebP output support

1 participant