[Ilugc] LJ Tech Tip

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Wed Sep 26 15:33:07 2007

TECH TIP: Choose Graphics Formats Wisely

There's a reason so many different image file formats have been
developed: Not every format works well in every situation. If you have
solid text in an image that has not gradients, use the GIF format.
Because it uses only 8 bits per pixel, for color information, the GIF
format works well for images that have only a few colors (256 or less)
and strong contrast (as black text on a white background does). The
GIF format also provides lossless compression, which means it
compresses the images as much as it can without sacrificing image
quality. But skip the GIF format if you have photographs to display.

Photographs are better handled using the JPEG format, which was
specifically designed for photographs based upon how the human eye
perceives color. Using 24 bits (three 8-bit channels) to represent
each pixel, the JPEG format easily handles up to 16 million colors.
Unlike the GIF format, the JPEG format's compression is described as
lossy, which means (theoretically, at least) that by using it you are
throwing away data. The actual data loss is usually trivial, however,
and you can specify how much you want to compress an image, depending
on the degree of quality loss you are willing to accept. A bigger
disadvantage for some artists may be that the JPEG format doesn't
handle transparancy information. The GIF format does, but it can only
interpret transparency as either on or off for any given pixel,
leading to "stairsteps" in non rectangular regions of your image.

The PNG format, on the other hand, can handle various levels of
transparency and millions of colors. It also offers lossless
compression, so no data is sacrificed. Unfortunately, not all browsers
fully support the PNG format. For example, some recent versions of
Internet Explorer can't display PNG images if they contain
transparency information. If only all of our Website visitors used
Firefox!

Choose file formats wisely. Using JPEG images for every project just
isn't a good enough solution. And if you think choosing among these
choices is annoying, just wait until the Web (and all those browsers)
finally support vector images. Viva la SVG !

This is an excerpt from the new book The Artist's Guide to GIMP
Effects, authored by Michael J. Hammel and published by No Starch
Press. Copyright 2007, ISBN-13: 978-1-59327-121-3. For more
information, visit http://www.nostarch.com ;

HTH :)
--
Bharathi S

Other related posts: