Most web browsers can accommodate 2 types of web images directly in the browser, and the third type (PNG) is gaining a lot more support. Note, there are other image formats that some browsers support, but these three types are the most common.
The GIF file is and image format that was first developed by CompuServe. It is best used for images with flat colors. It offers the ability to “index” colors on your images to make sure that they contain only web safe colors or a small palette of colors and (with flat colored images) make the images smaller. You can also create animated images using GIF files.
The JPG or JPEG file format was created for photographic images. If an image has photographic qualities, without expanses of flat color, it is well suited to being a jpg file. Photographs that are saved as JPG files will generally be smaller than the same file saved in a GIF format.
The PNG or Portable Network Graphic is a graphic file format that was made for the web. It has better compression, color, and transparency than GIF files. PNG files don’t necessarily have to have the .png extension, but that's how you'll most often see them.