Performance and implementation of Animated WebP

There are some libraries to control the display of Gif but nothing for WebP.
What would be the most performant approach? should the frame be stored at widget level or is there some lower levels optimization like extending ImageCache?

1 Like

FWIW, I think this needs to be done at a lower level. I remember implementing the first toy implementation of animated GIF in Flutter, sometime in 2016. And it was very slow. These days, gif is supported by the engine like every other supported image format. Which means it’s parsed by a C(++) library. I expect WebP would be a similar story.

Though I may be wrong. Maybe Flutter engine already parses animated WebP and what you’re asking is extracting the frames of the animation from that and do something custom with it? If that’s so, you can completely ignore my comment, sorry!

1 Like

Thanks for the input Filip, it’s always welcome.

Flutter is decoding and play Animated WebP but does not expose, to my knowledge, any controls.

I’m thinking of decoding the many frames I need for each animations and store them to the ImageCache and then call them on demand from a widget… not sure it’s the best approach.

2 Likes