NEW FEATURE - GIF image support with animated bitmap handling#3484
Open
jetrotal wants to merge 2 commits intoEasyRPG:masterfrom
Open
NEW FEATURE - GIF image support with animated bitmap handling#3484jetrotal wants to merge 2 commits intoEasyRPG:masterfrom
jetrotal wants to merge 2 commits intoEasyRPG:masterfrom
Conversation
EasyRPG is now able to render gif animations. Based on libnsgif used in mkxp-z: https://github.com/netsurf-plan9/libnsgif (MIT license). This PR Introduces GIF image decoding and animation support by adding new source files for GIF and LZW decoding, animated bitmap management, and GIF image handling. Updates build scripts to include new sources, extends Bitmap creation to detect and load GIFs as AnimatedBitmap, and registers '.gif' as a supported image type. Also ensures proper virtual destructor in Bitmap and integrates animated bitmap update logic. I tried to inject the code very early on the image pipeline, to affect every image source. Known hiccups from current approach: Picture effects, such as flip or overlay color mode locks the gif into a single frame, I'm not that aware about the entire pipeline to solve that...
Added GNU GPL license headers to animated_bitmap and image_gif source/header files. Updated lzw.h and nsgif.h to add extern "C" guards for C++ compatibility and improved formatting and documentation. Minor cleanup in bitmap.cpp. Update README.md
Member
|
When I attempted implementing APNG (animated PNG) or AseSprite animation stuff I was stuck at exactly the same problem: The bitmap is duplicated via a blit and this causes the animation to be lost. :) The bitmap API is unfortunately far too complicated (sooooo many methods) and overwriting all of them is alot of work (and error prone as most overloads would be the same and just lame forwarders). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EasyRPG is now able to render gif animations.
Based on libnsgif used in mkxp-z: https://github.com/netsurf-plan9/libnsgif (MIT license).
gif for quick testing:

This PR Introduces GIF image decoding and animation support by adding new source files for GIF and LZW decoding, animated bitmap management, and GIF image handling. Updates build scripts to include new sources, extends Bitmap creation to detect and load GIFs as AnimatedBitmap, and registers '.gif' as a supported image type. Also ensures proper virtual destructor in Bitmap and integrates animated bitmap update logic.
I tried to inject the code very early on the image pipeline, to affect every image source.
Known hiccups from current approach: Picture effects, such as flip or overlay color mode locks the gif into a single frame, I'm not that aware about the entire pipeline to solve that...