Login
You're viewing the front-end.social public feed.
  • May 30, 2026, 1:27 PM

    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.

    💬 13🔄 115⭐ 208

Replies

  • 💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 6
  • 💬 0🔄 0⭐ 7
  • 💬 0🔄 0⭐ 9
  • May 30, 2026, 2:03 PM

    @lethalbit Honestly, I kinda get it now. The compression is still kinda okay, even compared against (8-bit palettized) PNGs. I was checking the file sizes of my test images compared to those same images converted to PNGs and was seeing about 5:4 ratios of file sizes (GIF to PNG).

    LZW is neat. GIF's version of it is a little tricky because of the table size changing as it encodes/decodes. But still way easier to implement than DEFLATE was for me.

    It's just a neat little format. I like that it's still in use. (Saying this while being well aware of many sites automatically converting then down to lossy video formats behind the scenes.)

    💬 1🔄 1⭐ 10
  • 💬 0🔄 0⭐ 0
  • May 30, 2026, 4:04 PM

    @ExpiredPopsicle these were some of my favorite bits of trivia from when i got familiar with the format as well :> i even have a little example to point to when i tell people that GIF is a lossless format supporting full 24-bit color and they don't believe me: lifning.info/gif-example/24_bi

    (i also began imagining an alternate timeline where the format wasn't patent-encumbered and the GIF data framing protocol filled the niche of WebSockets decades sooner)

    💬 1🔄 5⭐ 12
  • 💬 0🔄 0⭐ 4
  • May 30, 2026, 4:34 PM

    @Canageek it's not loading, per se - it's an animation where each frame is a 16x16 square (256 pixels, which happens to be the number of colors in a GIF color table) and is set to not erase the previous frames when displayed, thus gradually accumulating a full color image within the limitations of the format

    💬 1🔄 1⭐ 7
  • May 30, 2026, 5:06 PM

    @lifning Ah, thank you for explaining it! I was wondering if it was an animation meant to demonstrate the format, but it didn't loop at the end

    💬 0🔄 0⭐ 1
  • May 30, 2026, 4:18 PM

    @ExpiredPopsicle :3 writing GIF code is a neat little learning experience, partly because of all these little artifacts of its history that you pick up from reading the spec and such

    💬 0🔄 0⭐ 2
  • May 30, 2026, 4:23 PM

    @ExpiredPopsicle my favorite fact about the spec is that all the way back in the original '87 spec it specified terminal escapes for displaying GIFs inline and this never seemingly got implemented, now much much later we have a bunch of different equivalent escape based image embedding systems but we could've had that all the way since the beginning

    💬 0🔄 1⭐ 9
  • May 30, 2026, 5:21 PM

    @ExpiredPopsicle my favorite part of the GIF spec is that it doesn't have a "framerate", it has a display time set on each individual frame. Last I checked, some video editors don't handle this properly and will average out the framerate over the entire duration if you import a GIF

    💬 0🔄 0⭐ 1
  • 💬 1🔄 0⭐ 2
  • 💬 2🔄 0⭐ 3
  • 💬 0🔄 0⭐ 1
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1
  • 💬 1🔄 0⭐ 3
  • 💬 0🔄 0⭐ 2
  • May 30, 2026, 7:27 PM

    @ExpiredPopsicle

    From my crappy memory, GIF was developed for the CompuServ online service.

    The 89a specification that you immediately mentioned was an extension of GIF in, 1989.

    Thinking up things or imagining them, doesn't mean it exists.

    So, in GIF facts, it was not developed or intended for HTTP (World Wide Web) use. It was however, a nearly universal standardized image format that meshed perfectly with the advent of HTTP. With gigabytes of already available content and tools.

    💬 2🔄 1⭐ 2
  • May 30, 2026, 8:56 PM

    @SnowBlind2005

    @ExpiredPopsicle Yes, I remember most DOS utils described it as "compuserve gif". I had some memory of Autodesk Animator using Gif as a codec for 256-color-paletized static images (AA used FLC for animations). For some time, I used it as a more portable (not-windows intended) and better compressed alternative to windows 3.0 RLE BMP.

    💬 0🔄 0⭐ 2
  • 💬 0🔄 0⭐ 1
  • Jun 13, 2026, 5:35 PM

    @ExpiredPopsicle@vt.social ok so this is getting silly and somewhat inaccessible but could a high framerate gif flash 2 frames and thus tricking the eye into seeing more than 256 colors per frame? Or perhaps there is a framerate limit or some other issues im missing?

    Also very interesting stuff hmm

    💬 0🔄 0⭐ 0
  • Jun 13, 2026, 6:57 PM

    @ExpiredPopsicle I never know quite what the ratio of 'endearingly quirky' to 'wow, that's just cursed' when someone promises fun facts about a tech thing I always sort of assumed was safe-ish.

    Modern revival of retrocomputer palette juggling tricks?

    Does the 'plain text extension' leave rendering entirely up to the decoder or can you also drag font choices or other quirks into it?

    💬 0🔄 0⭐ 0
  • Jun 13, 2026, 6:58 PM
    @ExpiredPopsicle yaaay someone else with the cursed knowledge. at some point i want to work on a gif-based VN engine, that uses application extensions to do branching and stuff
    💬 0🔄 0⭐ 0