LWN.net Logo

On the appropriateness of various image formats...

On the appropriateness of various image formats...

Posted Mar 10, 2003 21:08 UTC (Mon) by roelofs (subscriber, #2599)
Parent article: Heartbeat 1.0.1 released

Jonathan et al.,

I've noticed several times now that you seem to incorporate within the occasional article (such as this one) a JPEG version of a logo that began life elsewhere as a GIF. While I applaud your efforts to avoid the use of GIFs, your seemingly automatic assumption that JPEG is an improvement is flawed in several respects:

  • As we're now all aware, the JPEG format may be as encumbered by patents as the GIF/LZW format is.
  • Despite its excellent performance on natural images, JPEG does not compress graphic images well. In this particular case, you've started with an image that ostensibly has 3 colors (background and two shades of red) plus some antialiasing (say, an extra 13 colors, for a total of 16), expanded it by a factor of six (4 bits to 24 bits), and then applied lossy compression that almost certainly results in an image that's still larger than the original--which, by definition, was lossless. (No, I haven't actually tested this particular image, but I did include a very similar example in my book, with precisely the results I've described here.)
  • The quality just, well...sucks. A lot. (It didn't even retain the white background color, which even JPEG should be able to handle.)

Upshot: use the best tool for the job. In this case (GIF conversion), that would be PNG. In cases involving photographic content, stick with JPEG (assuming you're OK with the patent issues). See this page and associated links for lots more details.

Greg Roelofs
PNG Group, etc.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds