Gif or JPEG?

Traditionally, JPEGs have been used for photo images, while GIFs have been reserved for graphics such as logos and banners. This is due to JPEG's "lossy" method of compression, which offers smaller file size but does not promise an exact match to the original image upon decompression. While these deviations are usually not noticeable in photos, they can sometimes create problems with certain types of graphics, especially those incorporating text.

The photo with millions of colors maintains its quality when optimized. Taking the image into GIF format looses quality and is still not as small in disk size as the JPEG.

However, when using clipart, vector graphics or banners. Gif format is the preferred. There are less colors in these types of images as opposed to photographs.

Note: JPEGS cannot have transparent portions in the image. Nor can JPEGS be animated without JavaScript.