

What's In A GIF - ch0wn
http://matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp

======
micheljansen
Good read. I just noted that Wikipedia also has quite an elaborate description
of the GIF format: <http://en.wikipedia.org/wiki/GIF#Example_GIF_file>

as well as for PNG:
[http://en.wikipedia.org/wiki/Portable_Network_Graphics#Techn...](http://en.wikipedia.org/wiki/Portable_Network_Graphics#Technical_details)

------
ChuckMcM
This is an excellent document for visual thinkers. I wish there were more of
them. It reminds me of my dog eared copy of TCP/IP Illustrated. Now that the
patents have all lapsed on GIF images it would seem to be a candidate for
coming back but of course the PNG standard has made great progress in the mean
time.

For a long time, and perhaps today, GIF was the most reliable way to have a
diagram in a web page that would display like you expected. I keep hoping that
SVG support will rise to the level that GIF support had in its hey day then I
can have a web page that goes from phone to 24" display and the drawings still
look nice.

------
nudded
I have recently implemented a basic GIF parser and writer in Haskell for a
school project. The code can be found here: <https://bitbucket.org/nudded/gif-
parser/src/>

I think it shows how easy it is to write parsers in Haskell. Don't bother to
look at the LZW decode and encode, it's rather dirty.

~~~
thesz
Quite clear LZW: <http://rosettacode.org/wiki/LZW_compression#Haskell>

Perhaps not compatible with GIF standard, but very clear.

------
rojabuck
A clear & approachable piece of documentation. What a fantastic resource a
library of such documents, for numerous major data formats, would be.

~~~
jayfuerstenberg
I remember reading tomes to understand how to parse BMPs and PICs back in the
DOS days for display in Mode 13h.

If I had an articulate page like this my life would've been a lot easier.

~~~
pan69
1600 pages of goodness.

[http://www.amazon.com/Programmers-Guide-EGA-Super-
Cards/dp/0...](http://www.amazon.com/Programmers-Guide-EGA-Super-
Cards/dp/0201624907/ref=sr_1_sc_2?s=books&ie=UTF8&qid=1322132918&sr=1-2-spell)

------
wladimir
Nice and clear overview!

But GIF? Is that format even still used?

I'd love to see this for webp, I really don't get that format yet and AFAIK
there is no overview of the format that is not a spec (i.e., horribly
detailed).

~~~
pornel
> Is that format even still used?

<http://httparchive.org/interesting.php>

34% of images on the web.

The Web needs education first, not another image format that those websites
won't use...

~~~
robin_reala
To be fair, the vast majority of the web is built and never touched again, so
I’m not surprised about that figure.

Regarding WebP, it’s nice to have options, but ImageOptim is getting PNGs down
close in size for me :)

~~~
icebraining
Not true, a ton of sites go offline after a few years. If Geocities was still
around it'd probably skew that value way up ;)

~~~
robin_reala
Geocities _is_ still around (under a different name): <http://reocities.com/>

------
enneff
Related: Rob Pike's article on GIF decoding with Go:
[http://blog.golang.org/2011/05/gif-decoder-exercise-in-go-
in...](http://blog.golang.org/2011/05/gif-decoder-exercise-in-go-
interfaces.html)

------
pkrumins
I once wrote node-gif (<https://github.com/pkrumins/node-gif>), a node.js
library for creating animated gifs. (Note: it only works with the old node
0.2.x.)

------
antirez
generating GIF in pure Tcl (2004) <https://github.com/antirez/gif-pure-tcl>

I remember that when I was playing with this code I was pretty shocked by the
elegance of LZW.

