The three biggest raster image formats on the web are JPEG (Joint Photographic Expert Group), GIF (Graphics Interchange Format), and PNG (Portable Network Graphics). Each format is good for different things:
The “Joint Photographic Expert Group” (JPEG) file format is best used on photographic images. This format uses a wide range of compression techniques to make images incredibly small. JPEG is a “lossy” format, meaning that every time you save an image to JPEG format, some of the color data within the file is permanently lost or changed. When saving, a “quality” setting is usually available to let you set how much of the image to change for compression purposes. The lower the quality, the higher the compression. This loss of quality tends to show up around sharp edges within the photograph.
The “Graphics Interchange Format” (GIF) is best used on graphical elements of a page and small animations. GIF is a “lossless” file format, meaning none of the color data is lost or changed when saving. GIF files tend to be small due to only storing 8 bits of color per color channel (rather than 16), but compression in a GIF file isn’t as efficient as JPEG or PNG for complex images.
The “Portable Network Graphics” (PNG) format is also great for photographs, but really shines with smooth gradients and images with transparency. Like GIF, PNG is also a lossless format. PNGs can support either 8-bit or 16-bit color, and sometimes 8-bit PNGs can compress photographs better than JPEGs.