June 12, 2003

Everyone knows GIF, the image file format most commonly found on web pages. The GIF file format is patented, which means that our free use of GIFs is by the grace of Unisys. All use of GIFs were free of royalty obligations until December 1994, after its wide-spread adoption on the web, when Unisys decided to start collecting royalties from anyone who writes software that can create or edit GIFs. This means Open Source graphics editors have a hard time supporting a very popular format. In response, BurnAllGIFs.org encourages web pages to never use GIFs, and instead use the completely open, unpatented and equally featureful PNG file format. Unfortunately, this isn't easy to do, as browser support is limited, with common browsers missing features like transparency. (PNG's alpha transparency for web pages would be cool, even better than GIF's binary transparency.)

The GIF patent expires on June 20. Do we still need PNG?

comments...

I didn't realize the gif patent expired soon. That's killer, that means GD will soon have gif write support without having to hack it.



You know, I think there is of course use for PNG's and browser support will increase eventually, even for alpha channels.



However, for optimizing text graphics, PNG just doesn't approach being able to create files as lightweight as gif. So for web graphics, gifs still have thier outstanding uses, and photoshop still generates them just fine.

In the name of accuracy in blogging, I should mention that it's the LZW compression algorithm that's patented, not the GIF format explicitly. But yeah, I assume that GD will have GIF-ability again once the patent expires.



Patches for GD to add GIF support, viable in countries where the LZW patent does not apply (supposedly Australia), are available here:

http://www.rime.com.au/gd/



The GD homepage doesn't mention the June 20 deadline or future GIF support, but I'm sure if Tim doesn't jump on the opportunity to distribute a full GIF-supporting version, others will.

http://www.boutell.com/gd/

Why do we even still need GIF? Just about all browsers since the version 4 days will render basic PNGs, although IE 6 still has an issue with PNG alpha channels. As long as you're not using transparency, your browser will display PNG.



As for PNGs being larger than GIF, that's simply untrue. If you're comparing a 24-bit PNG to an 8-bit GIF, well, you're not being entirely fair to PNG. Scale your PNG to only use 256 colors and see if it doesn't come out smaller. The only files I've seen which are smaller in GIF format are tiny icons (16x16 and less), where the PNG header of 40+ bytes is enough to outweigh the increased compression.



Meanwhile, you could sign the petition to Microsoft to include full PNG support in their browser at http://www.petitiononline.com/msiepng/petition.html. Not that it'll do a lot of good, what with Microsoft not shipping another browser until Longhorn. *sigh* IE 6 is good, but given the current competition (Mozilla, Opera, Konqueror/Safari), it's not good enough.