One of the biggest problems in the HDR process today are halos. Halos are most obvious on high-contrast edges where a darker area and a lighter area meet each other. You mostly see them where the sky meets buildings, trees, rocks etc. There are ways of avoiding halos by applying only moderate tone mapping settings. However, this also takes away a lot of the desired HDR look from the end result. Therefore, we need a way of fixing halos after the tone mapping. The most radical one is to replace those parts of the photo affected by the halos – in most cases the sky – with the sky of the original 0-ev exposure. However, that removes any effect of the tone mapping on the sky and especially clouds can look spectacular in an HDR. So this is only a solution for specific photos.
There are various techniques out there for removing halos in a less destructive way. I have tried a few of them and did not really come to terms with any of them. So, I was looking for a technique that would give me more control over the result, a technique that works non-destructively (without changing the actual bits of the image).
The figure above depicts a typical example for (moderate) halos in a tone-mapped HDR image. On the left side, you see the original image with a lighter shine around the mountain. On the right side I have marked the halo area that we will try to reduce.
Requirements and Assumptions
Learn how to mask like a pro!
The complete guide to layer masking in Photoshop
6-hour video course, 21 lessons, 20+ resources
I assume the following:
- You have created your HDR and it contains some moderate halos. Note that extreme halos are very hard to fix using the method I introduce. Extreme halos lead to a loss of details and color at the very edge. This edge becomes almost white. Do not push your tone mapping to this extreme!
- You have some masking skills and know in principle how to use the brush tool in Photoshop. I recommend a graphics tablet for this work.
The technique is based on two basic steps:
- We will use a Levels adjustment layer for which we decrease the Gamma setting to darken the image.
- We will create a layer mask for the Levels layer such that the darkening effect is only applied to the halo regions and that there are no visible seams in the final result.
- Create a Levels adjustment layer and set the gamma setting of this layer to about 0.8 (darker than normal). This new adjustment layer will have a default (white) layer mask. Click on this layer mask and press “Ctrl-I” on your keyboard to invert it. The mask will now be black.
- Select the region that contains the halos. In our case, this is the sky. Selecting this region can be arbitrarily complex. I will not go into the details here since there is a section in this cookbook about making complex selections. For now, I assume that you have made the selection.
- Press the Alt key and click on the inverted mask of the Levels adjustment layer. This will display the black mask on the screen with the active selection.
- We will now start painting on the selection border with a white brush. The brush will only apply to the selected area, i.e. the sky. Thus non of the area below the selection border will be affected. Choose the brush tool by pressing “b” on you keyboard. Choose a brush with about 300-400 pixels diameter and a hardness of 0%. Start painting right along the selection border. The middle of the brush should be on the selection border. The result will look like this:
If you Alt-click on the mask of the Levels adjustment layer again, the normal image view will be displayed again. By clicking on the eye icon next to the layer, you can switch it off and on again to see the effect in the image. The halo has already been reduced but probably not as seamless as you would like.
- To get rid of the seams, we will now apply the Gaussian blur filter (Filter > Blur > Gaussian Blur…). Set the radius to about 50, and apply the filter. This makes the white border wider and darker, creating a smoother transition to the black area above the rock.
This is a good step towards reducing the seams. However, it also darkens the white area directly above the selection border. This is the areas where the halos are at their worst. We need to make that area completely white again.
- Use the white brush again to make the area directly above the selection line completely white again. You do this by drawing along the border with the center of the brush inside the rock shape. Thus, only the outer 20-30% of the brush apply paint to the halo area.
- Check the image by Alt-clicking on the layer mask. If there are still seams, repeat steps 5 and 6 once again. Do this until you have a seamless transition. For the example image, I have repeated steps 5 and 6 four times and arrived at the following mask:
- Check the final image. You can adjust the brightness of the halo area by changing the gamma setting of the Levels layer. In doing so, you can fine-tune the reduction.
Here is a comparison of the look before and after the reduction:
As I have already indicated, the best way of reducing halos is during the tone mapping process. My tone mapping habits usually only lead to subtle halos as shown in the example image. These can be rather easily fixed using this technique. It can also be applied to more severe halos as long as there is enough information left in the halo area such that simple darkening works.