A Complete Guide to Web Design

(やまだぃちぅ) #1
288 Chapter 15 – JPEG Format

Minimizing JPEG File Size


Web Design in a Nutshell, eMatter Edition

“Optimized” JPEGs


Standard JPEGs use a precalculated, general purpose compression table (called the
Huffman table) for compressing an image. Some tools offer the ability to create an
“optimized” compression table that is customized for the particular image. This
results in better color fidelity and slightly smaller file sizes. This format is
supported on current browsers, however some (mostly older) browsers may have
trouble displaying optimized JPEGs.
The optimization option is presented differently in each tool:
Photoshop (4.0 and 5.0)
Select theBaseline (Optimized) option in the JPEG dialog box.
ImageReady 1.0
Check the “Optimized” checkbox in the Optimize palette.
Pro-JPEG (BoxTop Software)
Check the “Optimize Huffman Codes” checkbox in the Pro-JPEG dialog box.
HVS JPEG (Digital Frontiers)
In addition to optimizing Huffman Codes, HVS JPEG utilizes a different (and
unique) method of optimization that, according to Digital Frontiers, uses a
proprietary algorithm to base compression rates on a spatial frequency anal-
ysis of the image.
These optimization controls are grouped under the “Q-Table” options in the
dialog box (see Figure 15-1). “General” uses the standard compression table.
“Generate Optimized Q-Table” creates a customized table for the image.
In addition to these, HVS JPEG provides two predefined tables for optimizing
certain image types. “Portraits” is best used on images with smooth tones.
“Textured” is for images where it is important to preserve detail and texture.

Precompression Image Preparation


Simple JPEG compression does an admirable job of condensing photographic
images without requiring much extra attention. However, if you are serious about
making your JPEGs as compact as possible, you may want to maximize JPEG
compression’s strengths by feeding it the kind of image it likes—an image with
subtle gradations, fewer details, and no hard edges.
Preparing an image for better compression is a matter of adding blur effects to the
image prior to compression. This can be done manually in a general-purpose
program like Photoshop, or by using a built-in prefilter in a web-based graphics
tools. Both techniques are discussed below.

Using Adobe Photoshop (4.0 and 5.0)

Adding a slight Gaussian blur to an image—as small as .5 pixels—may result in a
10 to 15% reduction in file size. Of course, just how much blur you can safely add
without image degradation and how much file savings will result will vary by
image.
Free download pdf