Preparing photos for use on the Web and on mobile devices (like cell phones or smart phones) requires saving the image in a file format supported by the browsing environment and then creating the best-looking image you can while keeping the file size low for quick loading on any Internet connection.
Because this section pertains to photos—as opposed to line art, such as a solid-color logo or other image with no photographic or highly detailed content—the two most appropriate formats to use are JPEG or PNG (the third widely supported image format on the Web, GIF, does not present photographs well). JPEG is the standard for photos, and provides the depth of color and detail that photos, even at the lowest resolution, need to look good online or on a mobile device.
So, this chapter will focus on how to use Photoshop CS5 to prepare photos for the Web, exploring approaches and techniques that best handle preserving image quality while generating Web-ready images that download quickly and are accessible in any browsing environment.
Photoshop’s Save for Web & Devices window is almost an application in and of itself. It is the tool through which photos (or other artwork) opened and edited in Photoshop is compressed (reduced in file size) so that it will open quickly in a browser. And it’s where you define the type of file and compression to use in generating Web-ready artwork.
Most of this chapter will focus on using the Save for Web & Devices window, and we’ll zoom in on some features that make a big difference in how your photos appear online. To begin, let’s walk through the basic steps of using the Save for Web & Mobile Devices window.
The first step is to open your image file—in whatever format it was originally captured—in Photoshop. With Photoshop CS5 open, choose File > Open, and, in the Open dialog, navigate to and double-click on an image file to open it in Photoshop.
With the photo open in Photoshop, follow these steps to save it as a Web-ready file:
Figure 47a. Previewing four options for exporting an image to a Web-ready, compressed JPEG file.
Often images from a camera are too large to fit onto a Web page. Even $100 digital cameras are capable of taking high-quality images with pixel dimensions in the thousands. Those images must be reduced in size (and correspondingly in file size, to speed up downloading) to work on a Web page.
There are two basic solutions to resizing an image: cropping or rescaling. Cropping cuts out a part of the image, whereas rescaling changes the size of the entire image (while maintaining the same height-to-width ratio so as to avoid distorting the photo).
You can rescale an image in the Save for Web & Devices window. But you must crop an image before you launch the dialog.
To crop an image for the Web:
Figure 48a. Resizing a crop area (the Crop tool is selected in the toolbar).
The Save for Web & Mobile Devices is designed to fine-tune sizing to match a Web size or Mobile device, not to reduce images from their original (from a camera) size to a Web-appropriate size. So, before resizing an image in Save for Web & Mobile Devices, rescale your image in the regular Photoshop window:
Figure 49a. Resizing an image for the Web, and resampling to maximize image quality.
After you have resized your image to something close to the final output size, you can use Save for Web & Mobile Devices to tweak your image size by changing the settings in the Image Size area.
If you are creating Web images that must display well in a mobile device, you can use Adobe Device Central to test your image in a specific device.
To do that, follow these steps:
Figure 49b. Adding a test device in Device Central.
Figure 49c. Previewing and scaling an image in a device.
One of the most asked questions I get from students, readers, and clients is: What’s a quick, easy way to generate thumbnails? It’s an informed question—a huge part of the labor involved in preparing images for the Web involves creating small thumbnail “preview” versions of the images that download quickly and take up little page space, but give a visitor a good idea of what he or she will see if they click the thumbnail to open a full-sized image.
Sadly, Photoshop CS5 doesn’t incorporate any new tool or feature for generating thumbnails, but here’s a tried-and-true set of steps to do that.
To create thumbnails from full-size photos—to serve as links in a thumbnail gallery, for example—follow these steps:
Repeat these steps for other images you want to reduce to a thumbnail, or create an Action to automate the process (see sidebar).
There are two ways an image can download into a browser. Normally (by default) the image downloads line by line. You’ve probably experienced this. The downside is that it requires a visitor to watch the whole image download before they decide if they feel like waiting to see the image. Progressive or interlaced downloading solves this by having an image “fade in” from blurry and grainy, to full resolution.
Interlacing can be applied to GIF or PNG images in the Save for Web & Devices window. But JPEG is the best format for photos. While JPEG does not support interlacing, you can choose Progressive download in the Save for Web & Devices window (Figure 51a).
Figure 51a. Selecting Progressive downloading for a JPEG image.
Throughout the course of this chapter, I’ve alluded to or noted that there are three Web-friendly image formats to which you can save images: JPEG, PNG, and GIF.
Here’s a quick survey of the available settings for different formats:
• GIF, JPEG, and PNG have different compression options. When using the Save for Web & Devices dialog, the format you choose determines which of these options—for compression, dithering, and number of colors—are used to compose the image.
• JPEG offers none of these options, because the format itself supports millions of colors and provides lossy compression, and through your choices in the Quality settings, you determine how much is lost (Figure 52a).
Figure 52a. Comparing a highly compressed JPEG (right) to a high-quality JPEG (left).
• PNG 8 format offers Dither settings (Diffusion is the default, or you can set a percentage). You can also set the number of colors that will be used to create the image, from 2 to 256. Obviously, the higher the number, the clearer and more detailed the image will be. PNG 24 offers no Colors setting.
• GIF, like PNG 8, allows you to choose the number of colors that will be used to compose the image, make a Dither selection (using a definition—again, Diffusion is the default—and establishing a percentage). It also offers a Lossy setting, which allows you to determine how much detail is lost to compression. Another setting offered is Web Snap, which is set to 0% by default but can be increased to force Photoshop to set colors in the image closer to the Web-safe palette.
You can save artwork with transparent backgrounds in Photoshop as transparent GIF or PNG images for the Web. Let’s break that down a bit: You can create artwork in Photoshop that sits on a Web-page background, allowing the background to show through (Figure 53a).
Figure 53a. Artwork with a transparent background against a colored page background in Dreamweaver.
Using the check boxes (and the Transparency Dither settings), you can adjust the display of transparent pixels in the optimized image. There is no dithering option for PNG 24. If you choose Pattern, Noise, or Diffusion Dither (from the drop-down list that defaults to No Transparency Dither), the Amount field activates to the right, and you can enter a value or use the slider to determine how much dither to create (Figure 53b).
Figure 53b. Top left: no transparency; top right, PNG with transparency; bottom left: transparent GIF with no dithering; bottom right: transparent GIF with pattern transparency dithering.
3.139.103.204