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 409 bytes |
![]() JPG image 1234 bytes |
![]() 6 color Gif image 879 bytes |
![]() JPG image 3179 bytes |
![]() 8 color Gif image 879 bytes |
![]() 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 22234 bytes |
![]() JPG image 9623 bytes |