简体   繁体   中英

How can I resize GIF/Animated WebP image files in Android

How can we resize the gif and animated webp files in android? I was able to decode the webp and gif using glide but could not find the solution for encoding them into webp.

Finally I found the solution after lots of searching and exxperimenting.

For Gif:

  • Extract frames from gif using decoder
  • Resize the each bitmaps.
  • encode them into webp or gif using encoder

For Webp:

  • (Need Glid) use given code to extract frames as bitmaps.
  • Resize them
  • encode into gif/webp

(Delay is also available to use it with encoder)

Gif encoder decoder https://github.com/waynejo/android-ndk-gif

Webp Ecnoder https://github.com/b4rtaz/android-webp-encoder

Webp decoding using Glide: https://stackoverflow.com/a/64744296/9308731

Resizing: https://stackoverflow.com/a/32810187/9308731

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM