Return to Digital Photography Articles
Photoshop Save As vs Save For Web
One of the more confusing options in Photoshop CS2 arises when it comes time to save your edited image. There are two methods to save your photo: using the Save As dialog box or using the Save For Web dialog box. This article answers the question: what are the differences between save for web and save as, and when should I use Save for Web?
Photoshop offers two options to save your image after editing:
- File -> Save As ...
- File -> Save For Web ...
Both of these menu otpions create an output JPEG file from your working image, but they differ in both the available options, flexibility and representation of JPEG compression quality.
|If you plan to...||You should use|
|Create images for your website,
or optimize the file as small as possible
|Save For Web|
|Share images with others,
and you want viewers knowing shot time/date, etc.
|Share images with others,
and you do not want others knowing shot time/date, etc.
For example, stock photos, or concerns over privacy
|Save For Web|
Convert your image to a given file size,
|Save For Web|
|... for all other cases||Save As|
Photoshop Save As
The Save As dialog includes a very large number of output file formats, as it is the standard method by which users will generate their final image files. As this output method is not optimized towards transmission over a low data-rate medium (such as the internet), additional information is encoded into the resulting image at the cost of increased file size. As shown below, this additional data may consume approximately 40KB.
One of the main reason that photographers choose Save As instead of Save for Web when sharing photos is so that the EXIF metadata (which includes camera information and shot details) can be displayed to other interested viewers. Most photo sharing sites (such as pbase) automatically extract this EXIF information, for the benefit of other photographers. However, considering that it also includes the time and date of the original shot, it may have privacy implications.
As Save As does not support for 16-bit images, it may be necessary to convert to 8-bit first, save and then undo the color depth conversion step if you plan to continue working on the file. You can convert to 8 bit RGB by selecting Image -> Mode -> 8-bits/channel. Save for Web automatically converts the color depth for you.
Photoshop Save For Web
The Save For Web dialog box doesn't provide as much flexibility in the ouput image file formats as the Save As dialog, but it does offer more flexibility with each supported option. Supported output file formats include:
- JPEG - Selection of Quality level (1-100). No transparency.
- GIF - Different palette sizes (2-256) and dithering options define quality. Supports single-bit transparency.
- PNG-8 - Reduced color depth (2-256 colors) and dithering options defines quality. Supports multi-bit transparency.
- PNG-24 - "Lossless" 24-bit quality. Supports multi-bit transparency.
- WBMP - Black & White dithered output.
|Main window for Save for Web|
The focus on this page will be on the JPEG output format.
Save For Web JPEG output
Because the Save for Web command is intended to be used for images that are destined for display on the internet, one of the primary goals is in optimizing the file size as much as possible while still retaining acceptable image quality. To this end, two methods are used to achieve this: a) a live preview of changing JPEG compression quality sliders and b) the removal of all unnecessary metadata (JPEG markers) in the output file.
The main features in Save for Web include:
- Optimize to File Size: Ability to automatically select both the file format (JPEG or GIF) and JPEG compression level to achieve the selected file size.
- Removal of EXIF metadata. For many this is a useful feature, while others will completely avoid Save for Web because of it. For simple images on a web site or for privacy reasons, you may want to hide the time/date a photo was taken, or other parameters. But, if you plan to share your images on a photo hosting site and would like to indicate the focal length, aperture and other parameters to your viewers, Save for Web will not be the right method.
- Removal of Optional Markers. In most output JPEG files, special markers are used to indicate additional information or provide resiliency in the case of errors / corruption. The Save for Web method will remove these and still allow JPEG decoders to work.
ICC Color Profiles
Both Save for Web and Save As give you the option of including the ICC Color Profile within the image. Color profiles are used to the viewer's display how the RGB values within the image data should map to real-world colors. Assuming you have a color-managed environment (calibrated and profiled monitor), this profile is used to display the colors as they were intended to be shown.
Unfortunately, most web browsers don't read this profile and most people don't have calibrated monitors, so the default color space, sRGB is generally assumed. Therefore, if you are sharing your photos on the web, and your photos were shot in a color space such as Adobe RGB, it is strongly advised that you convert to sRGB first. Once you've done that, there is little need to include the ICC profile within the file.
Comparison of JPEG Markers
The differences between the output of the two JPEG compressed file saving methods is easily visible when comparing the JPEG (JFIF) files themselves. The JPEG (JFIF) file format specifies a number of mandatory markers as well as some optional ones. The chart below shows how Photoshop CS2 Save as and Photoshop CS2 Save for the Web compare at a low level, with the help of JPEGsnoop:
|Comparison of JPEG Markers in Photoshop|
|Save As||Save For Web||Description|
|SOI||SOI||Start of Image marker|
|APP0||APP0||Identifier, Version, resolution, JFIF extensions|
|APP1||EXIF data, Makernotes removed in both. (length ~ 5KB)|
|APP13||Photoshop IRB (Photoshop-specific data, including quality) (length ~5KB)|
|APP1||XML metadata (EXIF, IPTC, etc.) (length ~17KB)|
|APP2*||APP2*||ICC color profile (* optional) (length ~3KB)|
|APP12||Ducky tag - Save for Web Quality - stores the quality level (length 17B)|
|APP14||APP14||Encoding info: color transform (e.g. YCbCr, YCCK, RGB, CMYK) and whether or not the samples were blended (length 14B)|
|SOF0||SOF0||Baseline DCT, chroma subsampling|
|DRI||Restart Intervals - Adds a level of recovery in case of errors (length is variable, depends on frequency)|
|DHT||DHT||Huffman compression tables|
|SOS||SOS||Start of Scan: Image Data stream|
|EOI||EOI||End of Image marker|
As can be seen in the above table, the additional data stored within a Save As JPEG versus as Save for Web JPEG is typically in the order of ~ 40 KB. In most high-resolution photos, this extra is insignificant, but when trying to compress small images for web use, this overhead could be significant.
Extraction of Quality Setting in Save As
In files generated using Save As, you can derive the quality setting from the Photoshop IRB resource (0x0406) in the JPEG APP13 (0xFFED) marker. The following hex view is of an image saved with quality setting 2.
|0xFFFD||Quality 1 (Low)|
|0x0001||Quality 5 (Medium)|
|0x0004||Quality 8 (High)|
|0x0006||Quality 10 (Maximum)|
Extraction of Quality Setting in Save For Web
In files generated using Save For Web, you can derive the quality setting (1..100) from the Ducky resource in the JPEG APP12 (0xFFEC) marker (starts with null-terminated ASCII string Ducky). The percent value is stored in hex. The following hex view shows a file saved with quality setting 51 = 0x33:
Comparison of Save As vs Save For Web Quality
Many people are confused about why there is a difference in the definition of quality settings within Photoshop and furthermore, how they compare. The following table shows the two methods and the relative ordering of quality between the settings, from best to worst quality. See description below for the limitations of such an ordered comparison.
For more information: read about JPEG chroma subsampling.
|Method||JPEG Quality||Preset||Chroma Subsampling|
|Save For Web||100||Maximum||1x1|
|Save For Web||90||1x1|
|Save For Web||80||Very High||1x1|
|Save For Web||70||1x1|
|Save For Web||60||High||1x1|
|Save For Web||51||1x1|
|Save For Web||50||2x2|
|Save For Web||40||2x2|
|Save For Web||30||Medium||2x2|
|Save For Web||20||2x2|
|Save For Web||10||Low||2x2|
In graphical form, here is a chart that shows a comparison of the JPEG luminance and chrominance across the default presets, each with the equivalent JPEG standard "quality factor". Of course, it is important to note that the quality factor shown is not an accurate measure of image quality since they are only truly comparable quantities if both Save for Web and Save As were based on linear scalings of the quantization tables included in the JPEG Standard Annex. Since neither is based on the sample tables, the quality factor should only be taken as a very rough comparison measure. The graph is ordered by decreasing luminance quality factors.