webp icon indicating copy to clipboard operation
webp copied to clipboard

Animation Support

Open kixorz opened this issue 5 months ago • 1 comments

Animation Support for WebP Library

This pull request adds animation support to the WebP library.

What's Been Added

This implementation introduces a complete set of features for creating and encoding animated WebP images:

  • A new AnimationEncoder type that provides an intuitive API for building animations
  • Support for animation parameters like background color and loop count
  • Frame-level control over duration, position, blending, and disposal methods
  • Convenient helper functions for common animation encoding tasks
  • Comprehensive documentation with usage examples

Benefits

These additions enable users to:

  • Create animated WebP images directly within Go applications
  • Take advantage of WebP's superior compression for animations
  • Control all aspects of animation behavior through a clean, idiomatic Go API
  • Easily convert existing image sequences to the WebP animation format

Implementation Details

The implementation leverages the underlying libwebp C library while providing a Go-friendly interface. It follows the same design patterns as the existing WebP library code, maintaining consistency with the current codebase.

I've included a comprehensive example in animation_example_test.go that demonstrates the API usage and serves as documentation for users.

Request

I would appreciate your review of these changes. I believe this animation support will be a valuable addition to the library, enabling users to take full advantage of the WebP format's capabilities.

Please let me know if you have any questions or if there are any adjustments you'd like to see before merging.

Thank you for your consideration.

Adam Konrad

kixorz avatar Jul 06 '25 15:07 kixorz

@chai2010 你能合并动画支持吗?

makinghappen avatar Oct 24 '25 20:10 makinghappen