07-21-20 This free web sharpening utility has been released and now includes the ability to add film grain.
After you’ve spent all the time and effort to post-process a beautiful photograph, you’re probably going to want to share it online somehow. On your blog, on a social media site like Facebook or Instagram, or maybe just via email to friends and family. In all of these cases, there are some critical steps to make sure you are sharing an image which is easy to view, looks great on the viewer’s monitor, and is an appropriate size (since the full resolution image is rarely ideal because it makes too large a file, won’t look as sharp if you leave resizing up to a 3rd party, or you want to prevent theft of your full-resolution original).
I get questions regularly about web sharpening, including my preferred approach or how Photoshop’s “Export As” compare to “Save for Web (legacy)”. It’s an important topic with complicated answers. So I’m writing this post to not only help show my approach, but also provide a simple and free software tool for you to quickly and easily get better images to share online.
In this tutorial, you’ll learn how to use my free script to do the work for you, how to sharpen for the web manually, how my approach compares to other common approaches with Photoshop/Lightroom, and how web sharpening should be used in combination with capture and creative sharpening.
Free web sharpening script:
You can sharpen your own images using the workflow described below, or you can simply download and use my free web sharpening script. This script takes care of all the critical steps for you to get amazing results with minimal effort. Under its simple user interface, it uses an advanced/proprietary method that goes beyond the approach outlined below in order to provide more optimal results than would be practical to do manual. You can install it so that it shows up in Photoshop’s menus for easy access. And you can even assign it a shortcut key to run it anytime you need it.
How to use the web sharpening script:
This script is designed to create high quality images in the simplest way possible.
For those who want a little more control, hover over the “Sharpen” button and note that there are some extra options available by holding modifier keys. This gives you the ability to apply sharpening locally, use the “Save for Web” interactive controls to interactively optimize JPG compressions settings for the best file size and quality, or even convert to the P3 colorspace for Instagram (P3 is available on Photoshop CC for Mac only).
There are two ways to run the script. You can simply go to File / Scripts / Browse and run the script as needed. However, a much better option is to install it in Photoshop. Just follow the instructions that come with the script and you’ll see a new web sharpening option under the “Filter” menu in Photoshop. You can even assign a convenient shortcut to it (via Edit / Keyboard Shortcuts in Photoshop). For example, I have set <cmd><option><shift>-S to run my web sharpening script anytime I need it.
How to sharpen for the web manually:
Photoshop includes the “export as” and “save for web” utilities, but they do not take care of sharpening for you, and “export as” does not let you crop. Lightroom includes some convenient options, but again you can get better results using other methods and it does not give you control over cropping. If you want the best results, your best bet is to process the image manually or use a dedicated tool.
The general workflow for sharpening for the web manually involves several steps:
- Duplicate and flatten the image
- Convert to sRGB
- Remove sensitive metadata
- Save as a JPG file with appropriate settings
Let’s walk through each of these steps in detail…
Step 1: Duplicate and flatten the image
Unless you are sharing with another Photoshop user, the preferred file format is nearly always JPG. And while saving as a JPG will flatten the image automatically, it is better to do this manually first. The reason is simple: resizing and converting color spaces on the flattened image creates better results than you get by doing those steps on the layered image. For example, if you have an adjustment layer like curves in your image and convert from ProPhoto to sRGB, the image will change because the points in the curve are specific to the ProPhoto or sRGB color spaces and cannot be automatically adjusted for you.
My free sharpening script does this for you, and it always does it on a duplicate copy of your image (the original is not changed).
Step 2: Convert to sRGB
Even though color management and web browsers have been around for more than 25 years now, we still do not have broad support for proper color management on the internet. Many images are treated as if they are in the sRGB colorspace, regardless of whether that is true or not. As a result, sharing images that have not been converted to sRGB can easily cause some terrible results, particularly dull colors.. So even though many monitors support more expansive color gamuts (such as P3 or Adobe RGB), it is nearly always best to convert to sRGB when exporting to the web.
One exception to this is sharing images on Instagram, as they have built support for the P3 color profile into their platform. You can safely upload images in P3 there. However, you wouldn’t want to send that same file elsewhere and you may be setting yourself up for frustration if you try using different colorspaces for sharing images from a phone. If you want simplicity, stick with sRGB.
Conversion to sRGB can occur anytime after you flatten the document, but I prefer to do it early. That way, if you decide to play with different approaches to sharpening, you won’t have to redo this step.
If you use my free sharpening script, conversion to sRGB is automatic. You may alternatively hold <shift> while clicking “Sharp” to have the image output in Display P3 for enhanced color on services like Instagram (the filename will indicate that P3 has been used).
Step 3: Resize
There are several reasons to reduce the size of your image when exporting to the web. This reduces file size significantly. You’ll frequently get higher quality results when you upload the exact sizes recommended for a particular service than if you leave resizing to their system. And you may wish to protect your high quality originals from theft or misuse.
To resize in Photoshop:
- Go to Image / Image Size
- Leave the link icon on to constrain the aspect ratio
- Choose the desired height or width in pixels. The other dimension may not match exactly, so let one of the dimensions go longer than needed for now. You should not force the dimensions in this step, as you’ll distort the image by squishing it here instead of cropping it in the next step.
- Select “Bicubic (smooth gradients)” or “Bicubic sharper“. Use the sharper version if you want to retain greater detail before sharpening, or the smooth gradients version to help suppress halos. You can safely ignore the other methods for downsizing (see the Adobe site for more details).
- Ignore the resolution, it has absolutely no effect.
There are an endless number of optimal sizes for sharing online. The best choice depends on which platform you’re using (Facebook, Instagram, etc). It also depends on what your doing there (normal post, page banner, etc). And the best choices tend to change as these platforms evolve. For that reason, I recommend you simply Google something like “best image size for Instagram” to get the latest advice. For what its worth, 1080 pixels wide and 566-1350 pixels tall for Instagrame is ideal for Instagram at this time.
If you use my free sharpening script, just type in the desired final dimensions for width and height. If you have the “maintain aspect ratio” option checked, the height will be automatically set if you change width (and vice versa) so that the full image is used.
Step 4: Sharpen
When you reduce the size of the image, it may naturally appear more soft. So sharpening after resizing is an important step to maintain quality. You may also use this as an opportunity to give you image a bit more pop by adding sharpening. Deconvolution sharpening or creative sharpening such as high pass that you may do on the high resolution original is generally fine, but if you have done a lot sharpening, you may wish to use less sharpening at this phase. Regardless of any capture or creative sharpening you do on the master image, it is critical that you do this final output sharpening step after resizing to get the desired results.
There are several good options for sharpening:
- Unsharp mask.
- Start with 100 amount, 1 pixel radius, and threshold of 5.
- If you need to emphasize larger details, you may try a larger radius. Or if you are concerned with halos, try 0.5.
- You may increase the threshold to 10 if you wish to suppress sharpening of noise in smooth details.
- You may then increase or decrease the sharpening amount to get the desired amount of sharpening.
- Smart Sharpen offers a little more control over suppression of sharpening halos, if you’re willing to get comfortable with the highlight/shadow controls.
- Start with 100 amount, 1 pixel radius, reduce noise of 10-20%, and “remove” set to “lens blur”.
- If you wish to reduce halos, open the shadow and highlight controls (use shadow controls for dark halos and highlight controls for bright halos). Use the fade amount to control the amount of halo suppression, tonal width determine how far from black/white you want to suppress, and the radius controls how far from the edge to suppress (so 1-2 pixels is generally a good choice).
- Multi-stage sharpening via Filter / Sharpen / Sharpen. With this approach, you don’t resize directly to final dimensions in step #2. Instead, resize to 1.67x the final dimensions and run Sharpen (this filter has no options). Then resize to final dimensions and run Sharpen again. This is a popular technique amount many landscape photographers.
- Note: With any of these methods, the amount of optimal sharpening is affected by your resizing algorithm. For example, if you choose “Bicubic sharper”, the image will naturally need less sharpening to get to a similar result.
If you want to get more sharpening in some parts of the image (such as foreground details) and less elsewhere to avoid noise (such as the sky), you may wish to apply the sharpening locally. To do this, just duplicate your flattened layer and sharpen the top layer. Then use a layer mask to reveal the sharpening wherever desired.
If you use my free sharpening script, you may control the amount of sharpening using the sharpening amount slider in the script. Everything else is optimized for you automatically. This slider is set at the default recommended value of 100%, but you may increase or decrease it as desired for your specific image.
If you wish to sharpen locally with the script, hold <ctrl/cmd> while clicking “Sharpen” and a layered document will be created (but not saved) for you. Just paint black on the white mask of the sharpening layer to reveal the original (not sharpened version) underneath. So paint black on the mask in smooth areas like sky and water. Then save as a JPG with your preferred quality settings (you do not need to worry about flattening this document, as the limitations mentioned above do not apply in this simple scenario).
Step 5: Crop
There are many situations where you should crop your image. Resizing for platform-specific sizes to optimize quality often requires it. Or you may have other goals, such as cropping a landscape image to a square format to display better on Instagram. If you don’t crop the image, it will likely be cropped for you, often with a centered crop that gives poor results. If your image is close to the final dimensions, just go to Image / Canvas Size, type in the desired dimensions, and click OK. This will give you a centered crop. But if you are making a more significant crop, you should use a custom crop.
How to get a custom crop:
- Use the crop tool (shortcut <C>).
- Enter the desired image ratio in the toolbar to force the exact right ratio. Since you’ve already resized the image, the crop tool should be touching either the long or short edge perfectly and showing a centered crop of the other dimension.
- Simply click and drag on the image to achieve your desired crop. If you see the crop rectangle jump off the edges (because you didn’t more in a straight line vertically or horizontally), just slowly move back and it should snap into place on the edge.
- When everything looks good, just click <enter> to commit.
- Note that you can click on the grid icon in the toolbar to select helpful overlays, such as “golden ratio”.
I prefer to do this step after resizing and sharpening, at least when using a multi-stage approach to sharpening where you don’t get to the final resizing in one step.
If you use my free sharpening script, you must uncheck “maintain aspect ratio” in the script if you wish to crop the image. Otherwise, the image will be resizing proportionally and used in full. If the dimensions you then choose are not proportional to the original height and width, the image will be cropped. If a very slight crop is needed, it will be done for you. If a larger crop is needed, you will be be provided with an option and instructions to customize the crop after you click “Sharp”. The image is never stretched, just cropped when necessary.
Step 6: Remove sensitive metadata
Your camera records a lot of information about shutter speed, aperture, etc as “metadata”. Most of this is fine or even preferable to share. However, you may also be sharing information you wish to keep private, such as the GPS location, the date the image was taken, serial numbers for your camera or phone, etc. While you may edit some of this data under File / File Info in Photoshop, much of it cannot be changed there. A simple solution is to use File / Export As or File / Save for Web in Photoshop. While these tools also allow you to resize the image, they do not have sharpening tools built into them, so I would still do the other steps above before using Photoshop’s export tools.
Another option is to create an export action in Lightroom that has metadata settings set to “Copyright only”. You can use such a Lightroom export to flatten and resize the image as well if you like, and then simply sharpen in Photoshop.
If you use my free sharpening script, just use the checkbox option to control whether the image is saved with all metadata or just your copyright information.
Step 7: Save as a JPG file with appropriate settings
There are many file formats used on the web, the most common are JPG, GIF, and PNG. GIF is useful for making animations, but should be avoided for sharing photos online due to its generally low quality. PNG has some advantages such as 16-bit depth (which is unnecessary compared to a properly prepared JPG) and transparency (which is useful for marketing images on a website but generally not something you’d want to share photos), but are typically 5X larger or more.
JPG is the way to go. It provides very high quality, small file sizes, and is the most compatible. When you save as JPG in Photoshop, there are several choices and I would generally recommend the following:
- Leave embed color profile checked. If you have converted to sRGB, most browsers and applications will correctly assume what do for this missing profile, but why leave it to chance? The sRGB profile changes the file size of your image by less than 1%, so there is no reason not to embed it. And if you are outputting your image in Display P3 or some other color space, it is critical that you embed the colorspace.
- Quality = 6-10 is generally ideal. Using 6 is fine for most use, but higher values will help reduce some artifacts which may be particularly useful if you expect the user will zoom into view your image larger than 100%.
- Format = Baseline Optimized. This should reduce the size of your image by about 7% and is widely compatible. I am not aware of any modern browsers or social media services that have problems with this format. But if you want to ensure 100% compatibility with every conceivable piece of outdated software, you may choose to use Baseline Standard instead for a slightly larger file.
If you use my free sharpening script, all of this is taken care of for you by the quality dropdown option.
- Good creates the smallest file size and should be indistinguishable from the other options in most cases.
- High is great if you are concerned that viewers may zoom in more than 100% when viewing your work.
- Ultimate offers the best quality compression as well as dithering, making this the ideal choice if you see any compression artifacts with the other options, if you are concerned with possible banding in the sky or other smooth gradients, or if you just want to ensure the best quality and do not care about file size. Files saved with “ultimate” quality are typically 4x larger than those saved using “good”.
How should does this approach compare with using Photoshop’s “Export As” or “Save for Web”?
Photoshop includes a couple of relevant utilities under the File / Export menu (CS6 just have “Save for Web” under the File menu). However, neither includes sharpening, which should be done after resizing. That’s a serious issue if you want to create the best-looking photos. Neither give you any control over cropping. It’s possible, but you always get a centered crop. And both interfaces include an intimidating number of choices which aren’t important for most photography. These are ultimately tools optimized for people who create websites, iOS apps, etc.
On the other hand, both Export As (in CC 2020 or later) and Save for Web include a very nice “2-up” preview where you can compare the image quality degradation for different levels of compression and resulting file size. If you are trying to make a website load a few hundred milliseconds faster by creating the smallest files possible, this may be a helpful way to find the perfect quality setting for your image. Otherwise, if you’re just uploading to Instagram and such, I wouldn’t worry about it. **
There are some important differences between these tools.
- Export As offers a simpler interface (it also offers the ability to save files with dimensions larger than 8192 pixels, but that’s not relevant for 99.9% of web files).
- Export As also offers a “Quick Export” that lets you define your preferred JPG settings and then you can assign a shortcut key to this menu option for one-click export. Note that there is no option to have the sRGB profile embedded. Probably not a big deal since it is generally assumed, but I generally prefer to leave it embedded as it adds almost nothing to the file size and helps avoid potential display issues if some software or browser doesn’t assume sRGB.
- Save for Web offers a little more control over JPG settings (whether “progressive” or “optimized” options are used for support of legacy browsers) and the ability to use a 4-up mode if you really want to nerd out on compression optimization. It’s also the only option for 2-Up display on any version of Photoshop older than CC 2020.
** If you are using my free script, hold <shift> while clicking “Sharpen” to invoke the “Save for Web” interface. You will need to manually set your preferred settings for each comparison version of the image. If you used <ctrl/cmd> to create a layered file for local sharpening, just run the script again with the image open and it Save for Web will be invoked automatically. This allows you to combine the best of both to get optimal sharpening from the script and use Save for Web’s handy interface to determine how much JPG compression you would like to use.
How should does this approach compare with using “Lightroom”?
Lightroom’s export has some very good tools for exporting that include resizing, converting to sRGB, and even sharpening. However, you cannot crop (unless you make and virtual copies before exporting, and its still hard to get perfect crops to hit specific pixel dimensions for Instagram, etc). And while the three levels of sharpening are pretty good, you cannot apply the sharpening locally and sometimes an image benefits from more sharpening than the “high” amount allows in Lightroom.
If you are using Lightroom, create an export preset with appropriate File Settings (JPEG, sRGB, preferred quality), Image Sizing, and Output Sharpening (screen / standard).
How should web sharpening be used with other forms of sharpening?
Proper sharpening generally falls into three categories: capture sharpening, creative sharpening, and output sharpening.
You may also hear this type of sharpening referred to as “input sharpening”, “camera sharpening”, or “RAW sharpening”. You may also hear it referred to by the name of a specific technique (such as deconvolution sharpening). But don’t get confused, they all refer to the same concept aiming to improve the quality of fine detail of your original image. This is a technical form of sharpening designed to offset the limits of our equipment. This helps offset some natural softness caused by filters, lenses, etc. When done correctly, capture sharpening can help you get higher quality enlargements for print. However, because this improves fine detail of the full resolution file, this has no significant effect on web sharpening and isn’t very important in the the context of this article.
Unlike the other forms of sharpening which compensate for limitations of our equipment, this phase of sharpening is purely intended for creative purposes. A simple way to think of this is the sharpening you would apply locally (after capture sharpening) in order to get the best looking image at its original resolution. As this is an artistic process, there aren’t as many standard “rules”, but techniques such as “high pass sharpening” are common in creative sharpening.
This category includes the web sharpening we are doing here, as well as print sharpening. Unlike capture sharpening, creative sharpening is likely to affect the low resolution image you create for sharing online, so the amount of web sharpening you need may likely be affected by this stage of the process. If you process your images with a consistent style, you can probably use the same output sharpening settings for most of your work – but it still depends on the image content and you may wish to apply output sharpening locally if you wish to fully optimize the results. By “locally”, I mean to enhance sharpness where it is really needed as in step #4 above. Also note that by applying the output sharpening locally, I’m also making output sharpening a somewhat creative process.
Web sharpening is also very different from print sharpening. In print sharpening, the softening occurs after you have saved your file (during printing). So you need to compensate and add more sharpening that looks ideal on your monitor. That’s not the case with web sharpening, where the softness is created when the image is resized.
With web sharpening, it is generally best to evaluate the sharpening at 100%. If you think your audience is going to zoom into the image, you may wish to view at 200% or so and add a little more sharpening. Or your audience may be viewing on a screen where the physical size of the pixels are larger than the screen on which you are editing. But don’t fall into the trap of zooming further into your image, as that is not how it will be viewed and it may cause you to make some sub-optimal choices. The most likely result of “pixel peeping” is that you’ll waste a lot of time worry about or fixing issues that no one will ever be able to see. When you’re done, be sure look at the image at 100% for a final check.
To get the free web sharpening script, sign up for my free newsletter to get the download link, or check the bottom of the latest newsletter if you’re already a subscriber.
Be sure to also see the updated version with support for adding film grain.