Web graphics are usually saved as either of two types of files - a .gif or .jpg. Each of these has a unique was of compressing the files to optimize download time for the client. As a developer different types of images are optimal for the different types as well.
A .gif file is usually used for images with a large areas of one color. The are usually illustrations. The compression method used in saving these files is known as lossless compression, because the quality of the image is not compromised during the compression.
On the other hand, a .jpg is known for lossy compression. This type of compression with decrease the quality of the image proportionately to the amount of compression applied. This type of image is usually used for photographic images or images with many gradients.
Each of these methods can be previewed before being chosen when using Adobe Photoshop's 'Save for the Web' option (See figure 1.1 below). When choosing this option you can preview the different methods for compressing the file and the effects it has on the image quality and size. They are then easily saved to the folder of your choice.
It is important to choose the smallest size available while not compromising the quality of the image too much, because a user usually does not want to wait several minutes before a page completes loading.