Currently there are three dominant file types found on the Internet: GIF, JPEG, and PNG. Learn how each can work to help us preserve image integrity, while keeping files sizes minimal. Properly optimizing your graphics will make your site look more professional, and reduce the amount of time your visitors spend waiting for your pages to download.
Web Graphics Overview - Joint Photographic Experts Group (JPEG) (Page 3 of 5 )
This file is named after the body that developed the format, the Joint Photographic Experts Group (try repeating that a few dozen times at the next cocktail party you attend). When naming a file, it's truncated to JPG for compatibility with file systems that require a three-letter extension. JPEGs are best suited for images with subtle and smooth color transitions. Photographs, grayscale, and images with thousands or millions of colors fall into this category. JPEG uses "lossy" compression, it throws away information to save space and create smaller files. The more compression you use, the smaller the file becomes. The resulting trade off is image degradation. The trick is to use as much compression as possible, while maintaining usable image quality. I find that a quality of 3, or medium, is often acceptable, but it's a completely subjective call. Standard JPEG encoding does not allow interlacing, but the Progressive JPEG format does. Progressive JPEGs start out with large blocks of color that gradually become more detailed. Many older browsers do not support the Progressive JPEG format, and their use has been slow to catch on.
Some notes about JPEG files: It's best not to sharpen an image very much that you intend to save as a JPEG. Again, JPEGs work best with smooth, gradual changes. Sharpening an image exaggerates edges, and forces sudden changes in tonal values. This works against JPEG compression. In fact, you can create a smaller file by applying some Gaussian blur. Except for special situations, I don't actually recommend doing this, as you can end up with a muddy and indistinct image.
Don't over compress an image. Too much compression results in unattractive noise and distortion. Try saving a JPEG with a quality of 0 and you'll see what I mean. That sort of treatment can render a file completely useless. Like many good things in life, too much is not a good thing.
Text and JPEGs aren't good friends. Text (and other line-based images) suffers at the hands of JPEG compression. By nature, JPEG tries to break an image up into little blocks and average all of the colors out. You don't want that with text. Text has to be sharp and crisp to stay legible. Saving a line based image as a JPEG makes it unattractive at best. At the worst it becomes unreadable.