There are hundreds of different image file formats, all with different advantages and disadvantages. The GIF, PNG, and JPEG formats are most often used to display images in web design. There are 2 main types of compression for these formats lossy and lossless.
Graphic Interchange Format know as a GIF, has a lossless compression and works best for images with only a couple of colors, line drawings and simple diagrams or grayscale and black and white type. The main disadvantage of the GIF image format is it only works with a few colours, 8 bits per pixel or less most good colour images are 24 bits per pixel.
Portable Network Graphics, the PNG file format, this is also a lossless image format. The PNG uses truecolour. This means the PNG is good to use for final photographic images. This works better than using a GIF format because its file size can be reduced (upto 30% more than PNG) at the same time as keeping the quality of the image. Like GIFs you can control the opacity of a single colour, but with a PNG images can be saved in grayscale and palette formats as well as truecolour.
Joint Pictures Expert Group, a Jpeg. This file format was designed for the scale of images and photos, both in grayscale and full colour. The Jpeg is a format that is that should not be used for images of lettering and typography nor with diagrams or drawings. The Jpeg is the standard image used when designing a website. A jpeg is a lossy image format, compression will trade off the size of the file against the quality of the image, the smaller you make the file size the worse the quality.