See examples/encode_animation.rs for source code of encoding the above image - example converted to gif for all-browser support, see the example.webp file Underlying WebP format processing is handled ...