Image Optimization Chart

if your image...

use... because...

is graphical, with flat colours

GIF

it will compress more effiently and keep colours flat and crisp, resulting in higher quality images at smaller file sizes.

is photographic or contains gradations of colour, such as a watercolour painting JPEG the JPEG compression works best on images with blends of colours, and it can portray images with millions of colours, resulting in better image quality at smaller file sizes.
is a combination of flat and photographic art, such as a banner with text on a flat background and a small photographic image

GIF

 

in most cases, it is better to preserve your flat colours and crisp edges and to tolerate a little dithering in the photographic edge than to turn the whole image over to JPEG compression.
is a postaghe stamp - or icon-sized photograph GIF or JPEG although JPEG is better suited for photographic images. I have found that when the image dimensions are really small, GIF usually creates smaller file sizes with acceptable image quality. it is advisable to try both and find the one that works best for your particular image.
includes a transparent area GIF it's the only file format that supports transparency.
needs to be animated GIF it's the only file format that supports native animation.