Skip to content

feat: add animated WebP encoding and decoding support#103

Open
xfalcox wants to merge 1 commit intojamsinclair:mainfrom
xfalcox:claude/add-animated-webp
Open

feat: add animated WebP encoding and decoding support#103
xfalcox wants to merge 1 commit intojamsinclair:mainfrom
xfalcox:claude/add-animated-webp

Conversation

@xfalcox
Copy link
Copy Markdown

@xfalcox xfalcox commented Mar 30, 2026

Encoder:

  • encodeAnimated(frames, options) accepts array of {imageData, duration} and produces animated WebP with infinite loop via WebPAnimEncoder API
  • Links against libwebpmux for muxing frames into container

Decoder:

  • decode(buffer) now handles both static and animated WebP (falls back to demux API for animated files, returning first composited frame)
  • decodeAnimated(buffer) returns array of {imageData, duration} frames with proper alpha blending and disposal method handling
  • isAnimated(buffer) returns boolean
  • Links against libwebpdemux for demuxing animated WebP

Also upgrades EMSDK from 2.0.34 to 3.1.57 to fix terser minifier crash.

@xfalcox xfalcox force-pushed the claude/add-animated-webp branch from 32d64bd to cd7bf5c Compare March 30, 2026 20:27
Encoder:
- encodeAnimated(frames, options) accepts array of {imageData, duration}
  and produces animated WebP with infinite loop via WebPAnimEncoder API
- Links against libwebpmux for muxing frames into container

Decoder:
- decode(buffer) now handles both static and animated WebP (falls back
  to demux API for animated files, returning first composited frame)
- decodeAnimated(buffer) returns array of {imageData, duration} frames
  with proper alpha blending and disposal method handling
- isAnimated(buffer) returns boolean
- Links against libwebpdemux for demuxing animated WebP

Also upgrades EMSDK from 2.0.34 to 3.1.57 to fix terser minifier crash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xfalcox xfalcox force-pushed the claude/add-animated-webp branch from cd7bf5c to 060566b Compare March 30, 2026 20:29
@jamsinclair
Copy link
Copy Markdown
Owner

Thanks @xfalcox. This is awesome.

If it's ok, I'll take a look at these PRs over the weekend and get back to you with any comments 🙏

I can check, but did claude use the existing #75 as reference at all?

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.

2 participants