Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

Expert Optimization: Five Tips for Optimizing JPEGs in Photoshop CS2

These days, no Web visitor has the time or patience to wait for slow-loading graphics. In the time it takes to load a large, beautiful photograph, a user can be long gone! But you don't have to abandon photographs altogether; Tanya Staples covers quick techniques for dramatically reducing the file size of those JPEG images while maintaining the finest of details.
Like this article? We recommend

Optimizing images for the Web is an art and a science. As a Web designer, it's your job to create the best-looking images with the smallest file size. Over the next five articles, I'll show you my favorite tips for optimizing images for the Web.

There are only a few graphic file formats you can use on the Web. The two most popular are JPEG and GIF. In this article, we'll focus on the basics of JPEG optimization. In the next article, we'll get into the details of GIF optimization.

When you optimize images as JPEGs in Photoshop CS2, it's important to understand what you can do to make the smallest possible files. Here's an overview:

  • Start with the right type of image. JPEG stands for Joint Photographic Experts Group. The JPEG compression algorithm is designed for optimizing and compressing continuous-tone images, such as photographs or images with gradients or glows. The JPEG file format looks for areas with low contrast, subtle variations in color, and slight tonal shifts. It doesn't compress areas of solid color effectively and, as a result, doesn't work well for flat, graphic-style artwork.

    Figure 1 and Figure 2 show two images that are best suited to JPEG optimization because they contain photographic content. Although Figure 1 appears to have some areas of the same color, there are slight variations in the tonal range, which makes it better suited to the JPEG file format, rather than the GIF file format.

  • Increase JPEG compression. The more you compress a JPEG, the smaller the file size. Unfortunately, adding too much JPEG compression can cause unwanted compression artifacts. The trick is to find the balance between making the file small and making it look good. Here's how:
    • Add blur. The softer the edges, the smaller the file. Because the JPEG compression algorithm has an easier time when compressing areas with subtle transitions in colors and tonal range, adding a small amount of blur to your images can help reduce file size.
    • Decrease the saturation. The less color saturation, the smaller the file size. Again, because compression is easiest with subtle changes in colors and tonal range, decreasing the saturation in images can help reduce file size.
    • Decrease the contrast. The lower the contrast, the smaller the file size. The JPEG compression algorithm favors low-contrast images. Decreasing the contrast in an image can help reduce file size.

Now that you have an idea of what helps make small JPEGs, it's time to put theory to practice and learn how to optimize a JPEG in Photoshop CS2.

  1. Open a photograph or continuous-tone image in Photoshop CS2. Figure 3 shows a photograph with a close-up of a salad and a candle. This photograph will pose a few issues because of the stark contrasts in color and tonal range between the candle and the salad.
  2. Choose File > Save For Web to open the Save For Web dialog box.
  3. Choose JPEG from the Optimized File Format pop-up menu. Click the 4-Up tab so you can see a preview of the original image and three optimized previews.

    Starting with the 4-Up tab is useful because it lets you compare three optimized previews, each with different JPEG compression settings, to determine the best starting point for the JPEG compression setting.

  4. Take a look at the previews and quality setting for each of the three optimized previews (see Figure 4). The quality setting, which is controlled by the Quality slider in the Save For Web dialog box, reflects the amount of JPEG compression. The higher the quality, the lower the JPEG compression. The lower the value, the higher the JPEG compression.

    Select the Zoom tool from the Save For Web Toolbox and click one of the previews to zoom in on the candle. If necessary, select the Hand tool and click-and-drag to reposition the preview.

  5. Take a look at the size and quality of each preview. Notice that the preview with the quality setting of 60 looks almost identical to the original but the file size is 47.65KB (see Figure 5). The preview with the quality setting of 15 has a small file size of only 16.15KB, but there are nasty JPEG compression artifacts around the candle. The preview with the quality setting of 30 has a few artifacts, but also has a reasonable file size of 23.02KB. Based on this information, the preview with the quality setting of 30 is the best starting point for optimizing this image.
  6. Click the preview with the quality setting of 30 to select it and then click the 2-Up tab.

    Now that you have a good starting point, you can focus on the optimization settings for that one preview. Switching to the 2-Up view gives you a larger preview of the image you're optimizing while still having a preview of the original for comparison.

  7. Experiment with the Quality slider in the Save For Web dialog box. Although you know 30 is a good starting point, you may be able to increase or decrease the Quality setting slightly to produce an even better result. In Figure 6, increasing the Quality setting to 28 shaved 1KB from the file size (for a total of 22.12KB) but didn't negatively affect the quality of the image.
  8. Experiment with the Blur slider in the Save For Web dialog box. As you learned earlier in this tutorial, the JPEG compression algorithm prefers soft edges. Adding a little bit of blur can help decrease the file size slightly without compromising the image quality. As Figure 7 shows, increasing the Blur setting to .23 didn't affect the crisp edges in the image but decreased the file size by 1KB (for a total of 21.61KB). Although it may not seem like a huge savings, every little bit helps when you're optimizing Web graphics.

    Although we've significantly decreased the file size from the original 70KB to 21.61KB, there are two other things you can do to make this file slightly smaller. As you learned earlier in this tutorial, decreasing the saturation and decreasing the contrast helps create smaller JPEGs. In the next few steps, you'll do just that.

  9. Click Done in the Save For Web dialog box. Clicking Done (instead of Cancel) causes Photoshop CS2 to remember the settings you specified in the Save For Web dialog box, so you don't have to start from scratch the next time you open the dialog box.
  10. In Photoshop CS2, choose Image > Adjustments > Hue/Saturation to open the Hue/Saturation dialog box. Decrease the Saturation setting slightly. The goal is to decrease the amount of saturation without negatively compromising the photograph. In Figure 8, decreasing the saturation to [ms]15 only slightly reduces the saturation but, as you will see, it will have a savings on file size when you optimize the image. Click OK to close the Hue/Saturation dialog box.
  11. Choose File > Save For Web. With the same optimization settings, you've reduced the file size by another 1KB (for a total of 20.8KB) without negatively affecting the quality of the image, as shown in Figure 9. Next you'll reduce the contrast.
  12. Click Done in the Save For Web dialog box.
  13. Choose Image > Adjustments > Brightness/Contrast. Decrease the Contrast setting slightly. As with decreasing saturation, the goal is to decrease the amount of contrast without negatively compromising the photograph. In Figure 10, decreasing the saturation to [ms]8 only slightly reduces the contrast but, as you will see, it will have a savings on file size when you optimize the image. Click OK to close the Brightness/Contrast dialog box.
  14. Choose File > Save For Web. With the same optimization settings, you've reduced the file size by another 1KB (for a total of 19.78KB) without negatively affecting the quality of the image. In fact, this optimized version is almost as small as the optimized preview image with the quality setting of 15. As Figure 11 shows, this image looks a lot better than that preview did because there are hardly any JPEG compression artifacts.
  15. Click Save to open the Save Optimized As dialog box. Specify a filename, choose a location where you want to save the optimized file, and click Save. When you save optimized images in Photoshop CS2, it saves a copy so you never have to worry about losing or altering the original image.

You're done! As you can see, there is more to creating small, high-quality, optimized JPEGs for the Web than just increasing the JPEG compression. By adjusting the blur, saturation, and contrast, you created a small file with minimal JPEG artifacts. Use these principles as you work with your own photographs. Next month you'll learn the basics of optimizing GIFs.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020