WebDevelopersNotes logo

home-icon Home / Graphics / When do I use GIFs?

When do I use GIFs?

When do I use GIFs?

The Gif file format should ideally be employed for line art, cartoons and images that contain text because they preserve the sharp lines of shapes and text in the graphic. Further, line art and cartoons generally contain areas of flat color, which is very well suited for the LZW compression algorithm.

Note the difference in file sizes of the images below.

8 color Gif image
8 color Gif image
409 bytes
JPG image
JPG image
1234 bytes
6 color Gif image
6 color Gif image
879 bytes
JPG image
JPG image
3179 bytes
8 color Gif image
8 color Gif image
879 bytes
JPG image
JPG image
3174 bytes

Photographs should not be saved in the GIF file format for two main reasons

  • Photographs generally contain more than 256 colors.
  • Photographs are very complex images and the LZW algorithm is not able to do justice to the file size.
256 color Gif image
256 color Gif image
22234 bytes
JPG image
JPG image
9623 bytes

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Why we hate Internet Explorer?

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

URL shortening services like bit.ly and owl.ly use the TLD of Libya. [more...]