When an image is optimized for display on the web, the smallest file size to display an image with the highest quality possible is used. Pixels and colors are compressed to form an image that looks as good as the original, but at a fraction of the file size. This may involve many techniques, such as file type selection, color mapping, selective compression, ditheringthe options are vast in the world of Photoshop and can be confusing. Knowing how to approach optimization when preparing images for the web, therefore, is the key to getting images that look great and download quickly. Get the most from your imagesYou've been handed two filesa JPEG image taken with a digital camera and a logo graphic saved as a TIFFand have been told to get these images on the web, pronto. However, both of these files are too large to be efficiently displayed in a web browser and, in the case of the TIFF, probably won't display at all. In this article, we'll show you how to approach this scenario using Photoshop's optimization tools. Adjusting the JPEG fileOur JPEG file was taken using a 3.34 megapixel digital camera, which produced a great shot with plenty of image information. If we were printing this file, it would make a good 5 x 7 and a decent 8 x 10. However, the image information needed to print a high-quality image is mostly overkill when displaying an image on a computer monitor. Resize the image dimensionsBy default, monitors display images at 72 dpi, meaning our 8 MB JPEG file displays at about 27 inches by 20 inches. Few things are more annoying than having to use scroll bars to reveal an entire image or wait for a bloated file to download, so we need to resize this image to better fit on a web page.
Note After you resize your image, it will probably shrink down to a miniscule size on your screen. Don't worry because that isn't the size it's going to be on the web. While you change the image size, Photoshop keeps the same magnification level as the original image. To see the actual size of the image, select View Compress the image With our image dimensions and resolution under control, we can make our compression selections. 1. Select File Save For Web to open the expansive Save For Web dialog box, which is shown in Figure B. 2. Click on the Preset dropdown list in the upper-right corner. Here, you can select the type of optimized file format you'd like to use. For a continuous tone image, sticking with JPEG is really the only way to go, so select JPEG High from the menu. As shown in Figure C, there are a number of options to choose from when optimizing a JPEG. By selecting JPEG High, the options are filled with preset values. While these settings are a good start, it's best to fine-tune them to get the best possible quality. However, we're just going to concentrate on setting the Quality. JPEGs can be compressed at variable levels, with 100% being the least compressed and 0% being the most compressed. As you decrease the Quality setting, you sacrifice image detail but create a smaller file. The trick is to find a good balance between file size and image quality. The best way to do so is to trust your eyes. 1. Click on the Optimized tab in the Preview window of the Save For Web dialog box. 2. Double-click on the Zoom tool Note When evaluating compression levels, always work at actual size to get the most accurate representation of your image. Set the compression levelThere are many techniques for testing compression levels, but here's one to start with.
The Save For Web dialog box also includes a feature for viewing compression options side-by-side. Switch from the Optimized tab to the 4-up tab, as shown in Figure D. Now your image displays with four different compression options, making it even easier to pick a winner. If you find a compression setting you like, simply click on the image and the setting is applied. Figure D.Save the JPEG fileThe last thing to do is save the file.
Working with the logoOptimizing the logo file is going be a bit different, as we need to convert it to a better file format for the web. The best choice for illustrations, line art, or logos, such as ours with large areas of flat color and detailed lines, is the GIF format. GIFs compress images by limiting the number of colors that make up the image. The key to getting a good-looking GIF is to reduce the colors in the image without losing important image information. As shown in Figure E, our logo file uses only a few colors and some text. Since the text characters are big and bold, converting to the GIF format will work fine. If you had smaller characters of more complex visual elements like shadows and gradients, you may need to use a JPEG to conserve the finer details. Figure E.Size it upAs with the JPEG file, the first step is to resize the image. Be careful when resizing artwork similar to our logo file, as the details can start to look "soft" when you resample the image.
Note So, what if you've optimized an image for the web, but you need to use that image to make a print. Check out the Problem : Solution "Improve resampled images for print" at the end of this chapter. Be wise, optimizeBy evaluating the type of file you're working with and selecting an appropriate file format, optimizing your image files for the web can be easy. In this article, we compressed an 8.05 MB JPEG to 17 KB and a 7.56 MB TIFF to a 6 KB GIF, both huge savings in file space. This file reduction didn't degrade our image quality, as we used compression and image dimensions wisely to optimize the files to display the best on the web. The result is fast-loading images that look great and complement your web design, instead of detracting from it. |