Fun #GIF facts learned while writing the GIF loader for #Godot...

- The GIF 89a spec only uses the word "animation" or any other form of it twice, in the part where it says... "Animation - The Graphics Interchange Format is not intended as a platform for animation, even though it can be done in a limited way."

- GIFs can support more than 256 colors. While a GIF palette can only go up to 256 colors, each sub-image can have its own palette which, combined with other sub-images, can result in a final image with more than 256 colors.

- GIFs have a "user input flag" on graphic control extensions for sub-images, meaning that animated GIFs can actually wait for user input before advancing to the next frame. To my knowledge, modern decoders ignore this.

- The GIF 89a spec has a section for text rendering. There is an entire "plain text extension" that remains unimplemented on most modern decoders. So far I can only find one GIF that uses this (along with the user input flag), and one very old decoder for DOS that supports it. This is not related to GIF comment extensions.

- The "loop" count is a nonstandard Netscape 2.0 extension, implemented as an "application extension". GIFs otherwise are not expected to loop.

- The initial GIF version was invented in 1987, but "the web" was invented in 89, meaning the format was likely never intended to be used in web pages.

I finally "finished" my from-scratch #GIF loader for #Godot , written entirely in #GDScript.

https://codeberg.org/ExpiredPopsicle/GodotGIFLoader

It's an initial version that could definitely use some optimization. It doesn't yet treat GIFs as an asset format, but that is pretty easy to hook up. And I still want to implement the plain text extension, even though no other modern GIF decoder supports it.

But for now, it serves the purpose I needed it for, which was for on-stream animated #Twitch emote handling.

#GodotEngine

GodotGIFLoader

I wrote a GIF loader in GDScript! It's kinda slow.

Codeberg.org
๐ŸŒง๏ธ๐ŸŒง๏ธ๐ŸŒง๏ธ #rain #weather #gif