1. GIF - "Graphics Interchange Format" was created by the good folks at Compuserve. The 8-bit GIF format has long been one of the most popular on the Web. It uses lossless compression and supports a maximum of 256 colors and is best suited for line drawings or graphics containing large blocks of solid color. GIFs are compressed using a technique called LZW, an algorithm that reduces the file sizes of images by finding repeated patterns of pixels. LZW compression never degrades the image quality.
GIFs can also be animated which is another reasons for their popularity. Prior to the release of Flash, most banner ads were created using animated GIFs.
Another reason for the popularity of GIF is that it supports transparency which allows the background of your Web page to appear behind your image.
2. JPEG is short for "Joint Photographic Experts Group" (try saying that 5X fast) and is the original name of the committee that wrote the standard. JPEG is a lossy compression technique designed to compress color and grayscale continuous-tone images - think photographs and complex imagery containing millions of colors. This compression technique can be applied on a sliding scale ranging from 0% compression for a perfect image, to 100% compression for a smaller file size but a poor quality image. A compression setting between 60% and 70% usually results in a good balance between image quality and file size. JPEG should NOT be used for simple images like line drawings or images containing basic shapes and only a few solid blocks of color.
3. "Portable Network Graphics" or PNG was developed specifically for the Web as a alternative (and an improvement) to the GIF format. Using lossless compression, PNG images can be 5% - 25% more compressed than the same GIF image. PNG also supports transparency using alpha channels which allow you to specify the opacity of any pixel from 0 to 255, 0 = full transparency and 255 = fully opaque.
PNG formats include: PNG8 which supports 256 colors and 1-bit transparency, and PNG24 - 24-bit color on par with that of JPEG. However, PNG24 should not be considered a substitue for JPEG and should be used when working with complex graphics.
Until recenly the only knock on PNG was browser support of transparency. Happily, this issue has changed for the better and support is now very good to excellent.