There is a huge range of different types of compressed image files, but the three file types most commonly found on the Internet are PNG, JPEG, and GIF.
GIF (Graphics Interchange Format) is a bitmap image format introduced in 1987 by CompuServe, an early public networking service. GIF uses a maximum of 8 bits per pixel, so an image can have up to 256 distinct RGB colors. The GIF format allows for animated images, unlike the other formats mentioned below.
GIF images are a good choice for line drawings and simple graphics or if animation is required. They should be avoided for images with gradients or photos.
This Wikipedia article gives more information about the GIF file format.
The JPEG (Joint Photographic Experts Group) format uses lossy compression. Users can choose the amount of compression used, giving better image quality along with the smallest practicable file size. The following graph (from Wikipedia) shows the link between quality and file size.
JPEG images sometimes suffer from “artifacting,” causing pixelization and strange halos around parts of an image, often where there is sharp contrast between colours. High-contrast images need to be saved at a higher quality to look good.
JPEG images are useful for photos, especially without high contrast, and for screenshots, especially of movies or games. They should avoided for images with high contrast, detailed images, especially diagrams, and simple graphics, due to large file sizes.
This Wikipedia article gives more information about the JPEG file format.
PNG (Portable Network Graphics) is another bitmapped image format that uses lossless data compression. For many years it was not supported by Internet Explorer, making it less commonly used than GIF and JPEG, but it is now supported by every major browser. PNG files support palette-based color (24-bit RGB or 32-bit RGBA), greyscale, RGBA and RGB colour spaces. It also offers a number of transparency options, including alpha channel transparency.
PNG is good for line art, illustrations, photos with high contrast, transparency, especially alpha channel transparency, and application screenshots or other detailed diagrams. It should be avoided for photos with low contrast as file sizes are larger.
This Wikipedia article gives more information about the PNG file format.