pixelmatix / GifDecoder

MIT License
23 stars 9 forks source link

Replacing GIF decoding with AnimatedGIF Library #1

Closed embedded-creations closed 3 years ago

embedded-creations commented 3 years ago

A few weeks after I did the first release of GifDecoder, the AnimatedGIF Library was released and it looks to be a much more efficient GIF decoder, and with an active developer making improvements and fixing bugs. I was planning to switch my code using the old AnimatedGIFs sketch or GifDecoder library over to AnimatedGIF, but I think there's still room for a GIF library with a more beginner friendly API. AnimatedGIF requires the sketch to include some callback functions that are a little complex, e.g. the GIF disposal methods are implemented in the user's sketch, not in the library.

I updated GifDecoder to act as a wrapper for AnimatedGIF, keeping the API nearly the same and adding any complex code like handling the GIF disposal methods inside the GifDecoder class. I didn't implement support for 16-bit color palettes or the DrawPixelRow() callback that's needed for the Arcada GifDecoder as some thought needs to go into how to tell GifDecoder to choose between 24-bit and 16-bit palettes (previously it was hardcoded with a #define).

I have a branch with these changes, and the SmartMatrixGifPlayer example is running:

https://github.com/pixelmatix/GifDecoder/tree/AGifLibrary

embedded-creations commented 3 years ago

@PaintYourDragon I saw you were evaluating the AnimatedGIF library, and you might be wanting to update the Arcada GifDecoder library to improve efficiency, etc. Most of the work is done already in this branch. Some thought needs to go into supporting 16-bit palettes (right now it's hardcoded for 24-bit).

I'm sure the GifDecoder API isn't the best, and maybe now's a good time to rework it, while keeping it easy to use and adapt to other platforms. If you're interested in this I'm happy to collaborate with you on the project. I have some time and motivation over the next two weeks (the earlier the better), and then I'm going to be getting busy with other projects. LMK!