The following files were saved in various formats from a single 24 bit 72 ppi RGB test image created in Photoshop 5.0. The image contains a smooth color gradient, fine 1-pixel anti-aliased lines, and anti-aliased text so that image quality and detail can be compared following various file compression choices for web graphics.
Next to each image is the file format, quality setting, and file size of each. Compare image quality vs file size (larger file size = longer download time). Even at the highest levels of quality, detail in the image is lost compared to the original uncompressed native Photoshop file (not shown).
(note: Progressive Network Graphics ".png" format not fully supported on all browser versions.)

JPG; setting 10 (highest qual); 45kB

JPG; setting 5 (med qual); 23 kB

JPG; setting 0 (lowest qual); 16 kB

GIF; 8 bit (adaptive palette;256 colors); 28 kB

GIF; 6 bit (adaptive palette; 64 colors); 14 kB

GIF; 4 bit (adaptive palette; 16 colors); 8 kB