GIF is the right format for images that are composed primarily of lines and solid blocks of color. Its compression scheme condenses repeated bits of the same color down to a single instruction that says, for example, orange bits.
A GIF image's color palette is limited to a maximum of 256 colors. Use the GIF format for indexed images of 256 or fewer colors. The graphic must already be indexed with a color resolution of 8 bits or less to save it as a GIF. Avoid using the GIF format for images with complex, subtle gradations of color. For these images, use JPEG instead, since, generally speaking, JPEG is superior to GIF for storing full-color or gray-scale images of realistic scenes; that means scanned photographs, continuous-tone artwork, and similar material. Any smooth variation in color, such as occurs in highlighted or shaded areas, will be represented more faithfully and in less space by JPEG than by GIF.
When saving an image in the GIF file format, you can choose one (and only one!) color to be transparent. A transparent color is like a piece of clear glass; it is invisible and allows whatever is displayed beneath it to show through. Thus the GIF transparency feature enables you to create irregularly shaped images with the background showing through.
For more information: