As of version 5 and later, Photoshop includes a very helpful "Save for Web" command. This element enables you to save a copy of your image that is optimized for internet use. "Optimized" means that the image file will be as small as possible, and that the image will use only Web-safe colors. The "Save for Web" option can save images in GIF, JPEG, or PNG format.
Using Save for Web When your image is ready to be put onto your web page, select "Save for Web"... from the File menu. The "Save for Web" dialog appears:
This dialog box allows you to tell Photoshop how you'd like to optimize your graphic for the internet. You have the ability to select the file format to produce (GIF, JPEG or PNG), what size palette you'd like to use, how to cut down the colors to fit the chosen palette size, how much to dither the optimized image (if at all) and how much image quality to sacrifice in order to produce a smaller file size.
Image views You will see four tabs above the image view pane on the left. These panes allow you to view the original image, the optimized version, the original and optimized versions side-by-side ("2-Up") and the original, optimized and two variations on the optimization all together ("4-Up"). You can also use the Hand tool on the top-left to move the view around, the Zoom tool to zoom in and out of the image, and the Eyedropper tool to select a color from the image.
Presets There are a lot of options in the Save for Web dialog, and the choice can be quite bewildering! Luckily, there are a list of presets you can choose from to make it easier. Click the Settings: drop-down list (just below the Cancel button) to bring up the list of presets:
Three basic image formats exists in the presets - GIF, JPEG and PNG. The rule of thumb is to use JPEG's for photos and GIF's for all else. For a full guide on choosing the right image format, see Understanding image formats.
Optimising GIFs If you're making a GIF, start off with a preset such as GIF 32 Dithered, which should work well for most GIFs. You can then fine-tune the optimisation to suit your needs. Some of the important optimisation options are discussed below.
Colour reduction method This is the drop-down box below the Image Format box. The commonly used options here are:
Perceptual: Generates the reduced color palette which favors colors that the human eye is more sensitive to. Selective: Like Perceptual, but much better for Web work. The preferred option. Adaptive: Produces the palette by using an even sampling of colors from the image's color spectrum. By and large not quite as good as Selective. Web: Use this option if you need a complete Web-safe color palette (Netscape 216-colour palette). This usually isn't that important as most computer screens support at least 16 million colors. Dithering method This drop-down box is located below the "color reduction method" box. Dithering involves adding patterned or random dots to the image which make it look to have more colors than are actually in the palette, which allows you to use a smaller palette size. The options are:
No Dither: No dithering is applied to the image. Good if the dithering effect looks bad, but can produce severe "banding" of colours. Diffusion: Uses error diffusion dithering, which looks similar to Noise dithering, producing a random-looking pattern of dots. Can produce seams when using ImageReady slices. Pattern: Uses a pattern for dithering, rather than random dots. Can work well for some images, but often produces a rather artificial look to the image. Noise: Similar to Diffusion, but does not produce seams at the edges of slices in ImageReady. Transparency This checkbox is only available if your image does not have its Background layer turned on. It specifies that you want parts of the saved GIF to be transparent. If you deselect this checkbox, the transparent areas will instead be filled with the Matte colour (or white if no matte is selected).
Interlaced This checkbox controls GIF Interlacing. If enabled, the GIF will appear gradually as interlaced horizontal lines as it is loaded on the Web page, which gives viewers something to look at while the full image appears. It does increase the file size, however.
Lossy This slider allows you to remove some detail from the image, in order to reduce the file size further. Use only if you don't mind reducing the image quality quite severely! A value of 0 will not remove any detail; a value of 100 will remove the maximum amount of detail.
Colors This is where you can select the size of your GIF palette. A palette of 32 colors is often sufficient for web images, but if your image has a lot of detail and looks too fuzzy/blurry/banded with 32 you can bump it up it to 64, 128 or 256. If your image has very few colors in to start with, or doesn't look too bad with fewer colors, select 16, 8, 4 or even 2! This will make the GIF file size smaller.
Dither If you have selected a dithering method (see above), this option lets you control how much the image is dithered - 0 means no dithering, 100 means lots of dithering.
Matte Matte is the background color you wish to use for your image. If you've enabled Transparency (see above), then the foreground image will be faded at the edges to blend in with the matte color. If you choose the Matte setting of "None", the GIF will have a "hard transparency" with no fading; this is great if you want to be able to use the image on any color background.
If you've disabled Transparency, the transparent areas of your image will be filled in with the matte colour.
Web Snap If you want to use web-safe colours, increase the Web Snap slider. Photoshop will bias your colour palette more and more towards web-safe colours the higher the value of Web Snap.
Optimizing JPEGs If you're creating a JPEG you want to start off with a preset such as JPEG Medium, which works well for most JPEGs. Then you can fine-tune the optimization to suit your needs. Some of the important optimization choices are discussed below.
Quality Two ways to alter the compression quality include the Low/Medium/High/Maximum list (for quick access) and the Quality slider (for fine control). The lower the quality setting, the more blurry and bitty the JPEG will appear, but the resulting file size will be smaller.
Progressive A progressive JPEG is similar to an interlaced GIF. The image loads gradually on the Web page - a low res image first and then the full, high-resolution image. Again, this is great for keeping your viewers on slow modems from getting bored, but it does mean a slightly larger file size. Please note that older browsers don't support progressive JPEGs.
Matte If your Photoshop image has transparent areas, you can fill them with a specified matte color with this drop-down box.
Optimizing PNGs Your options for optimizing a PNG-24 are much the same as those for optimizing a JPEG. Similarly, the options for optimizing a PNG-8 are very similar to those for optimizing a GIF. See the GIF and JPEG sections above for details.
If you really can't be bothered... ...you can always allow Photoshop to optimize your image for you! Select the little arrow just to the right of the Settings... box and select Optimize to File Size...:
In the dialog that pops up, choose Auto Select GIF/JPEG then enter your desired file size. Click on OK and Photoshop will do the rest for you! If you're not pleased with the results you can tweak the settings as described in the sections above, or just choose a slightly larger file size and try again.
Saving the image Once you're happy with your optimised image, click OK to save it to disk. The file saved will be a copy of your original image, unless you specifically overwrite the original with the optimised file.
Using Save for Web When your image is ready to be put onto your web page, select "Save for Web"... from the File menu. The "Save for Web" dialog appears:
This dialog box allows you to tell Photoshop how you'd like to optimize your graphic for the internet. You have the ability to select the file format to produce (GIF, JPEG or PNG), what size palette you'd like to use, how to cut down the colors to fit the chosen palette size, how much to dither the optimized image (if at all) and how much image quality to sacrifice in order to produce a smaller file size.
Image views You will see four tabs above the image view pane on the left. These panes allow you to view the original image, the optimized version, the original and optimized versions side-by-side ("2-Up") and the original, optimized and two variations on the optimization all together ("4-Up"). You can also use the Hand tool on the top-left to move the view around, the Zoom tool to zoom in and out of the image, and the Eyedropper tool to select a color from the image.
Presets There are a lot of options in the Save for Web dialog, and the choice can be quite bewildering! Luckily, there are a list of presets you can choose from to make it easier. Click the Settings: drop-down list (just below the Cancel button) to bring up the list of presets:
Three basic image formats exists in the presets - GIF, JPEG and PNG. The rule of thumb is to use JPEG's for photos and GIF's for all else. For a full guide on choosing the right image format, see Understanding image formats.
Optimising GIFs If you're making a GIF, start off with a preset such as GIF 32 Dithered, which should work well for most GIFs. You can then fine-tune the optimisation to suit your needs. Some of the important optimisation options are discussed below.
Colour reduction method This is the drop-down box below the Image Format box. The commonly used options here are:
Perceptual: Generates the reduced color palette which favors colors that the human eye is more sensitive to. Selective: Like Perceptual, but much better for Web work. The preferred option. Adaptive: Produces the palette by using an even sampling of colors from the image's color spectrum. By and large not quite as good as Selective. Web: Use this option if you need a complete Web-safe color palette (Netscape 216-colour palette). This usually isn't that important as most computer screens support at least 16 million colors. Dithering method This drop-down box is located below the "color reduction method" box. Dithering involves adding patterned or random dots to the image which make it look to have more colors than are actually in the palette, which allows you to use a smaller palette size. The options are:
No Dither: No dithering is applied to the image. Good if the dithering effect looks bad, but can produce severe "banding" of colours. Diffusion: Uses error diffusion dithering, which looks similar to Noise dithering, producing a random-looking pattern of dots. Can produce seams when using ImageReady slices. Pattern: Uses a pattern for dithering, rather than random dots. Can work well for some images, but often produces a rather artificial look to the image. Noise: Similar to Diffusion, but does not produce seams at the edges of slices in ImageReady. Transparency This checkbox is only available if your image does not have its Background layer turned on. It specifies that you want parts of the saved GIF to be transparent. If you deselect this checkbox, the transparent areas will instead be filled with the Matte colour (or white if no matte is selected).
Interlaced This checkbox controls GIF Interlacing. If enabled, the GIF will appear gradually as interlaced horizontal lines as it is loaded on the Web page, which gives viewers something to look at while the full image appears. It does increase the file size, however.
Lossy This slider allows you to remove some detail from the image, in order to reduce the file size further. Use only if you don't mind reducing the image quality quite severely! A value of 0 will not remove any detail; a value of 100 will remove the maximum amount of detail.
Colors This is where you can select the size of your GIF palette. A palette of 32 colors is often sufficient for web images, but if your image has a lot of detail and looks too fuzzy/blurry/banded with 32 you can bump it up it to 64, 128 or 256. If your image has very few colors in to start with, or doesn't look too bad with fewer colors, select 16, 8, 4 or even 2! This will make the GIF file size smaller.
Dither If you have selected a dithering method (see above), this option lets you control how much the image is dithered - 0 means no dithering, 100 means lots of dithering.
Matte Matte is the background color you wish to use for your image. If you've enabled Transparency (see above), then the foreground image will be faded at the edges to blend in with the matte color. If you choose the Matte setting of "None", the GIF will have a "hard transparency" with no fading; this is great if you want to be able to use the image on any color background.
If you've disabled Transparency, the transparent areas of your image will be filled in with the matte colour.
Web Snap If you want to use web-safe colours, increase the Web Snap slider. Photoshop will bias your colour palette more and more towards web-safe colours the higher the value of Web Snap.
Optimizing JPEGs If you're creating a JPEG you want to start off with a preset such as JPEG Medium, which works well for most JPEGs. Then you can fine-tune the optimization to suit your needs. Some of the important optimization choices are discussed below.
Quality Two ways to alter the compression quality include the Low/Medium/High/Maximum list (for quick access) and the Quality slider (for fine control). The lower the quality setting, the more blurry and bitty the JPEG will appear, but the resulting file size will be smaller.
Progressive A progressive JPEG is similar to an interlaced GIF. The image loads gradually on the Web page - a low res image first and then the full, high-resolution image. Again, this is great for keeping your viewers on slow modems from getting bored, but it does mean a slightly larger file size. Please note that older browsers don't support progressive JPEGs.
Matte If your Photoshop image has transparent areas, you can fill them with a specified matte color with this drop-down box.
Optimizing PNGs Your options for optimizing a PNG-24 are much the same as those for optimizing a JPEG. Similarly, the options for optimizing a PNG-8 are very similar to those for optimizing a GIF. See the GIF and JPEG sections above for details.
If you really can't be bothered... ...you can always allow Photoshop to optimize your image for you! Select the little arrow just to the right of the Settings... box and select Optimize to File Size...:
In the dialog that pops up, choose Auto Select GIF/JPEG then enter your desired file size. Click on OK and Photoshop will do the rest for you! If you're not pleased with the results you can tweak the settings as described in the sections above, or just choose a slightly larger file size and try again.
Saving the image Once you're happy with your optimised image, click OK to save it to disk. The file saved will be a copy of your original image, unless you specifically overwrite the original with the optimised file.
About the Author:
Did you enjoy this article? Interested in learning photoshop fast? Well now you can by reading this free report...what are you waiting for?
