Photoshop CS2 Bible

When you can't decide between two (or worse , three) things, a side-by-side comparison can be a real help. Which shoes go with the dress? Try them on and look in the mirror, with the dress in question. Not sure whether gray or beige is the best interior for your new black car? Ask to see pictures of both and then choose. Understanding that seeing is believing, Photoshop lets you compare palettes and dither settings for a GIF image as well as contrast different qualities of JPEG compression. It'll even let you take a gander at your image in PNG, if your heart so desires (as if two choices weren't enough). You can even measure an image com- pressed with JPEG against that same image rendered as a low- color GIF. You know that expression "You can't compare apples and oranges?" Well, obviously it's wrong. In fact, you can compare all the fruit you want, and in just a few moments, you will. Meanwhile, throughout your many and varied comparisons, the original image remains on-screen so you always know where home is.

The command at work here is Save For Web. This one command lets you apply compression, index colors, add transparency, and even resize an image to make it small enough to fit on a page, all in one operation. So there's no need to use Save As, Indexed Color, or any of the others. In fact, Save For Web works best if you start at the point you normally do when saving a file, with a full-color image open on- screen, in its final state, ready and waiting to be unleashed on an eager public.

Tip  

Technically, you can choose Save For Web when working with a large, layered image and then scale and flatten the image inside the resulting dialog box. Well, you can, but you shouldn't. Big images can result in such slow performance that you find yourself suddenly impatient with your computer. You may even be prompted that you're trying to optimize an image not intended for the Save For Web dialog box ”i.e., a very large file. To avoid the seizure-inducing slow computer and the frenzy- producing prompt, flatten your image and resize it down to close to the desired dimensions before choosing Save For Web.

Caution  

When flattening and resizing your original file, which you may want to keep in a layered, larger-than-for-the-Web size , you might forget that you've taken this pre-Save For Web step, and end up with a saved, closed file that's lost its precious layers . To prevent the ensuing swearing and fist-pounding, save the file first, in its layered, larger size, and then flatten and reduce its size before using Save For Web. Remember that alleged drawback, that the optimized file had no connection to the original? Here's where that's a good thing.

So when you're ready, choose File Save For Web or press Ctrl+Shift+Alt+S ( z +Shift+Option+S on the Mac) to display the large window pictured in Figure 14-18. At first, you may think there's a lot going on here ” and you'd be right ” but don't worry. Many of the options duplicate functions that have already been discussed, and by default, you'll only see a 2-up view (the original and a single optimized version of the image). Those options that aren't familiar are logical and intelligible, provided you approach them in the following order.

Figure 14-18: Click the 4-Up tab at the top of the window to compare the original image (upper left by default) to three sets of Web compression settings. Conveniently, zooming or scrolling inside one preview zooms or scrolls them all.

STEPS: Optimizing an Image for the Web

  1. Click the tab for the display you want to use. When you first enter the Save For Web dialog box, you have to decide which image or images you'd like to preview. Photoshop defaults to the Optimized view, which shows the image with JPEG compression or color indexing applied, as it will appear when opened in a Web browser. To compare multiple settings at a time ” the real power of the window ” click on the 2-Up or 4-Up tab in the top left corner of the window. Figure 14-18 shows the 4-Up view, obviously.

    Tip  

    To get a better look at the image in the previews, scroll and zoom using the Hand tool and magnifying glass in the upper-left corner of the window. You can also use the standard navigation shortcuts, including spacebar for the Hand tool and Ctrl+plus or minus to zoom ( z +plus or minus on the Mac). To keep track of the active zoom ratio, keep an eye on the zoom level value in the lower-left corner of the window.

  2. Click a preview and choose the optimization settings you want to apply. By default, the first preview shows the original image, untainted by compression settings. You probably want to leave that one alone. But the others, you can click and change to your heart's content. You know when a preview is selected because a blue border appears around it.

    The optimization settings ” so-called because they optimize the file size for the Web ” run down the right side of the dialog box and change according to the file format that you select. Each time you change a setting or advance to the next one, Photoshop rebuilds the preview to show you the result.

    Tip  

    To preview a group of settings in your favorite Web browser, click the colorful world-and-question-mark button at the bottom of the window. If the button doesn't represent your favorite browser, choose another browser from the accompanying pop-up menu.

  3. Select the preview you like best and click the Save button. Photoshop displays a variation on the standard Save dialog box. But instead of selecting the file format ” you've already done that ” you specify whether you want Photoshop to create one or more image files, an HTML file describing a sample Web page, or both. Name the image and specify the location of your files on disk as usual.

Now that you understand the basic approach, the next few sections go into detail about the optimization settings for the JPEG and GIF file formats. If you would prefer to use one of the two PNG formats ” which rely on subsets of the same options used by GIF ” then reference the "GIF optimization settings" section.

Note  

In addition to GIF, JPEG, and PNG, Save For Web supports the Wireless Image Format (WBMP), which is a black-and-white bitmap format used by Web-surfing cell phones and other personal wireless devices. WBMP supports dithering, but beyond that, there's not much to say about it. If you can use it, great.

JPEG optimization settings

When you select JPEG from the format pop-up menu, you gain access to the options shown in Figure 14-19. Most duplicate options are found in the JPEG Options dialog box (refer to Figure 14-9), so there's no need to risk boring you and wasting paper explaining them all over again. Instead, take a look at the unique stuff:

Figure 14-19: JPEG image settings, displayed whenJPEG is chosen from thePreset/Settings menu. The resulting options are JPEG- specific.

GIF optimization settings

Selecting GIF from the format pop-up menu displays the slew of options shown in Figure 14-22. Many are familiar from the Indexed Color dialog box, and the redundant ones will be skipped in the following coverage. The new ones are as follows :

PNG optimization settings

It may seem as though PNG has gotten the short shrift in this book ” and it sort of has, but only because it's less commonly used for creating Web graphics. The bias toward JPEG and GIF is partially appropriate, and substantially not. As stated earlier, much of the problem with PNG is the result of rumor and innuendo; for a while, PNG was not universally supported by most browsers, so people shied away from it for creating Web images. That lack of support, however, was short-lived, and for the past few years , the current browsers have all supported PNG. The stigma stuck with PNG, however, and people just don't seem to use it as much as JPEG and GIF, despite it being a reasonable alternative.

Now, "reasonable" is quite a term . Juries must convict only when the prosecution has made its case beyond a "reasonable doubt." Reasonable people don't do rash, wild, unreasonable things. PNG is a reasonable choice for your Web-bound image, if your image would be a good GIF candidate ” loaded with high-contrast line art, large areas of solid color, and type. If this sounds like your image, PNG-8 is for you. With PNG-8, you get 128 colors, transparency, dithering and matte options, and even the Web Snap field is available ” check out Figure 14-22 if you don't believe it. You can reduce the number of colors, just like you can with a GIF file. You get a small file, great for fast-loading graphics. Nope, there's absolutely no reason not to go with PNG.

Figure 14-22: PNG-8's options are barely distinguishable from GIF's. For the appropriate image, PNG is a perfectly acceptable choice. The PNG-8 preview (lower right) shows that the image will be just a little bit smaller than its GIF128-color alternative (see upper-right preview) and will load a few seconds faster. The PNG-24 preview (see lower-left preview) will create a humongous file.

PNG-24 is supposed to be the equivalent of JPEG, and in terms of the way the image looks, it is; but as you can see in the preview in Figure 14-23, it creates incredibly large files ” files that take hundreds of seconds to load, based on the Save For Web dialog box estimates that appear beneath each preview. So it's not really a good choice for Web graphics, and that's really all there is to say. Of course, it does offer some very limited options ” a Transparency check box, an Interlaced option, and if Transparency is turned off, a Matte option that goes from dimmed to available, offering None, Eyedropper Color, White, Black, and Other (which spawns the Color Picker). No color table, no quality setting, no nothing else.

Figure 14-23: Optimizing slices (shown at top, left) independently can be dangerous because it can result in harsh edges between one slice and its neighbor when slices are assembled inside a browser (right). Link the slices to use one palette throughout (bottom, left).

The Optimize menu

So with PNG given more of its due, let's go back to discussing the more commonly used formats, JPEG and GIF, and their optimization options found in the Optimize menu, labeled back in Figure 14-18. This menu supplies a few extra goodies that are equally applicable to JPEG and GIF images:

The Preview menu

One last menu, loitering unpretentiously near the top of the Save For Web dialog box, controls the appearance and feedback provided by the previews. Its commands are divided into four sections:

Категории