O'Reilly logo

Web Design in a Nutshell by Jennifer Niederst

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Minimizing JPEG File Size

As for all files intended for Web delivery, it is important to optimize JPEGs to make them as small as possible. Because JPEGs are always 24-bit by nature, reducing bit-depth is not an option. For the most part, all you have to play with is the quality setting, however, it is possible to prepare an image prior to compression. There are a number of specialized tools available for making JPEGs as small as they can be while letting you make decisions about image quality.

Aggressive Compression Ratios

If your image has a lot of continuous tone or gradient colors, you can be pretty aggressive with the compression level and not worry too much about loss of quality in the resulting JPEG. Even at some of the lowest quality settings, (0 or 1 in Photoshop, 20-30 on the standard scale) the image quality is still suitable for viewing on web pages.

Of course, this depends on the individual image. Photoshop’s low-quality setting will result in a blocky or blotchy effect in areas of flat color, which may be unacceptable to you. You may need to do some testing to find the compression level that works best. Be sure to save a copy of the original image so you can do a fresh JPEG compression with each test.

ImageReady, Fireworks, ProJPEG, and HVS JPEG provide previews of the effects of your compression settings, both as an image preview and its corresponding file size. This makes it easier to experiment with compression ratios before saving the JPEG. With Photoshop and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required