ORGANIC
by
Keens DesignKeens Design
learning | downloads | about us
tips | web images | web development
 

Copyright © 2012

when to use gif?

Use GIF when there are large areas of uniform color and the total number of colors is smaller than 256. Consider the following image:

The original PNG(299 bytes):

This above original image is saved in the PNG lossless format.

Next, the image was saved as a GIF and as a JPEG:

The GIF (1,448 bytes):

The JPEG (2,436 bytes):

The GIF image is a flawless copy of the original. GIF can make flawless copy at high compression as long as the image contains large areas of uniform color, as long as the image has no more than 256 colors.

The JPEG image above is seriously degraded. The color of the circle has changed, and there are mottled areas in the (supposedly) white areas around the circle and the letters. Please note that the degradation of JPEG images is controllable. JPEG allows the user to choose the balance between file size and image quality, and one could choose better quality than in the above example. However, doing so results in an even larger file size for the JPEG.

In the above case, GIF provides a better, in fact perfect, rendition of the original, while delivering a smaller file size. For images like the above, always use GIF.

As browsers begin support for PNG, we will all want to abandon GIF. The PNG of the above image is smaller than the GIF, and PNG is not limited to 256 colors as is GIF.