a8 October 2014

Tutorial: Removing colour cast from photos in Photoshop

It often happens that our photos have some sort of colour cast. This can be introduced by using wrong colour balance when taking a photo or during post-processing.

In this tutorial I will show you a few ways on how to get rid of this issue from your photos. The techniques presented here will go from the very basic automatic ones, to a bit more advanced requiring some use of Photoshop tools.

Please also note that each of below methods might yield slighly different result and not all of them will work equally good for all photos, so it's good to know several techniques.

Here is the image I'll be working with today:
Original image
It has slightly exaggerated colour cast which will be useful to illustrate various method of removing it. There is definitely too much purple or blue in the image what's especially visible in sand on the left.

Fixing colour cast automatically

In fact there is automatic tool in Photoshop that attempts to remove colour cast from your images. You can access it from Image -> Auto Color.

However, as it is fully automatic tool, it doesn't get the job done correctly every time and leaves you no control over adjustments it makes. This together with the fact that it often guesses wrong is why I hardly ever use it. But sometimes, especially for some obvious colour casts, it can create very good results so it's good to know it's there as it can save you some time.

Here is how this method did for our example image:
Auto Color
Although it managed to remove purple cast completely it also introduced (or left) cyan or green tint in the image. Also the effect is too strong for me as a bit of purple would still be nice as it created nice atmosphere in the original image.

Using Match Colour

It's another automatic approach but this time it works sometimes :)
  1. Go to Image -> Adjustments -> Match Color
  2. Make sure to check Neutralize checkbox.
  3. If the effect is too strong, drag Fade slider to the right until you're happy with the result.
  4. Click OK button. 
From my experience it seems that this method seems to work fairly well if image has blue or green image cast but not that well where there is some yellowish tint in the picture.
Match Color
As you can see from above, Match Color did much better job than Auto Color. It removed colour cast but also let me keep some purple to achieve the atmosphere I wanted.

Using Average filter

Time for another technique. It's still very simple one but requires use of some Photoshop tools:
  1. Duplicate your Background layer by Layer -> Duplicate Layer
  2. Use Filter -> Blur -> Average. This turns your layer into one solid colour, which is average colour of all pixels, which is basically colour cast of your image.
  3. Invert colour in this layer by Image -> Adjustments -> Invert.
  4. Change blending mode of this layer to Colour.
  5. Decrease layer opacity to around 10 - 20%.
Why does it work? Average blur returns average colour of your image (it takes all pixels and calculates their mean). As such it can be consider colour cast.

What you need to do to remove colour cast is to add "opposite" colour and that's why we inverted it in step 3. By changing blending mode to Colour, you use this new opposite colour instead of the colour cast. However, the effect would often be too strong and that's why we had to reduce effect's opacity.
Average Blur
Another method and the results are getting even better :) and closer to what I envisioned for this image.

Finding White, Black and Gray Points

Last but not least a technique I use most often. All techniques above made an assumption that colour cast is the same for every pixel. But it is not necessarily the case. So this technique is removing colour cast from shadows, highlights and midtones separately.

Algorithm below might seem complicated at first but once you get to know it, you will be able to perform it in a few seconds. We'll start by finding colour of highlights, shadows and gray point in steps 1 to 11. Normally these should be white, black and 50% gray respectively. But if they aren't that means there is colour cast in them. In steps 12 to 17 we remove this colour cast from them.
  1. Start by creating Threshold adjustment layer just above your Background layer.
  2. Set Threshold Level to 255 in Threshold adjustment layer and start dragging the slider to the left until you start to see white areas in your image. These white areas correspond to highlights in your image.
  3. Select Color Sampler Tool and click on one of the white areas. By sampling these areas you know the colour of highlights. If they aren't close to white that means they have colour cast.

    In this example it was necessary to set the Threshold Level to around 240 for white areas to appear.
    Sampling highlights
  4. Now set threshold level to 1 in Threshold adjustment layer and start dragging the slider to the right until you start to see black areas in your image. These black areas correspond to shadows in your image.
  5. Select Color Sampler Tool and click on one of the black areas. By sampling these areas you know the colour of shadows. If they aren't close to black that means they have colour cast.

    In this example it was necessary to set the Threshold Level to around 6 for black areas to appear.
    Sampling shadows
  6. Now we'll find gray point colour cast. For this, create new layer (Layer -> New -> Layer).
  7. Go to Edit -> Fill.
  8. Select 50% Gray for Contents and click OK button.
  9. Set blending mode to Difference. Your image will now look something like this:
    Difference blending mode

    It does look strange so let me explain what's going on. Difference blending mode shows differences between current & bottom layers. If pixels in both layers are identical, output will be black. The bigger the difference, the lighter the output. It will be white for completely different pixels.

    Now, we filled our layer with 50% Gray which can be considered neutral colour for midtones. So areas similar to this colour will be very dark, almost black.
  10. Now set threshold level to 1 in Threshold adjustment layer and start dragging the slider to the right until you start to see black areas in your image. This time black areas correspond to midtones of your image.
  11. Select Color Sampler Tool and click on one of the black areas. By sampling these areas you know the colour of gray point. If it isn't close to 50% gray that means it has colour cast.

    In this example it was necessary to set the Threshold Level to around 6 for black areas to appear.
    Sampling midtones
  12. Now remove (or hide) both Threshold layer and 50% Gray layer as they won't be needed anymore.
  13. Create Curves adjustments layer.
  14. Select White Point picker from layer's settings and click on the 1st sampler point (one in the highlights).
  15. Select Black Point picker from layer's settings and click on the 2st sampler point (one in the shadows).
  16. Select Gray Point picker from layer's settings and click on the 3rd sampler point (one for the gray point). By performing steps 14 to 16 you will notice that shape of the curves in Curves adjustment layer changed.
  17. If you find the effect too strong, decrease layer opacity until you like the results (in the image below I set opacity of the effect to around 30%). Colour cast should now be removed.
And here is the result:
Fixing shadows, highlights and midtones
I think that this method produced the best results. The image is now much warmer and colour cast was removed.

Summary

This tutorial presented 4 ways of removing colour cast from your images, from 1-click automatic method, to more advanced ones. Even though automatic methods didn't yield perfect results in case of example image, there are cases when they are sufficient so it's good to know them.

Also there are numerous other techniques dealing with colour cast issue but as most of them is more complicated I think that they deserve separate articles so I might describe them in the future.

Post a Comment