Precise Color Cast Correction With Gray Fill Layers

Precise Color Cast Correction With Gray Fill Layers


Today food blogger Danny Jauregui of Food Bloggers Unite! gives us a great tutorial for neutralizing color casts in images. Click to enlarge most images in this tutorial.


Neutralizing a color cast can be one of the most difficult jobs in post-production. The problem I most often have is realizing that my image has a color cast, but not being able to identify which color is causing the cast! Is it magenta or red? Blue or cyan?

This simple tutorial solves this problem by finding neutral gray in the image, thereby removing the need to guess the color. In order for this trick to work however, your image MUST contain 50% gray tone somewhere in the image; otherwise the color correction will be off.

Step #1 – Add 50% Gray Fill Layer


Open your image and add a 50% fill layer by going to the bottom of the layer palette and clicking the ‘new layer’ icon. Next, on the top menu go to Edit> Fill> 50% Gray.

Step #2 – Change Layer Mode


Using the ‘Difference’ layer mode we will next find pixels in our image that are 50% gray. The ‘Difference’ mode is a comparative layer mode that will invert pixels containing 50% gray, turning those pixels black.

On the layer palette click the drop down menu containing the layer modes found on the upper left corner of the layer palette and change the mode of the gray layer from ‘Normal’ to ‘Difference’. Your image should now look like a funky negative. This layer is designed to help us find the 50% gray pixel only. It will be discarded once this is done.

Step #3 – Mark Gray Pixel with Eyedropper Tool


Select the eyedropper tool from the tools palette and zoom in very close to your image. I zoomed in 600%. The goal here is to find a pixel that is completely black. Once you’ve located a black pixel, hold the shift button down on your keyboard and click the eyedropper tool on the black pixel. This will add a marker identifying the 50% gray pixel.

Next, discard the gray/difference layer by clicking and dragging it to the trash on the bottom of the layer palette.

Step #4 – Neutralize Cast With Levels Adjustment


Now for the correction. Add a ‘Levels’ adjustment by clicking the adjustment layer button at the bottom of the layer palette. A selection of adjustments will appear. Select ‘Levels’.

A dialogue box will appear showing you the image histogram. On the lower right corner you will see three eyedropper icons. Click the middle eyedropper icon and move the cursor over to your image. This middle eyedropper tool sets the gray point, thereby shifting the color balance in the image.

Since we’ve already determined where our gray point is, all you have to do is place the mouse over the marker making sure that both points are precisely matched up. Because the default icon is an eyedropper, I find it hard to be accurate, so I change the icon to a crosshair by simply hitting the caps lock button on my keyboard. Once the two crosshairs are perfectly matched up all you have to do is click the mouse and the color should shift and neutralize.


Danny Jauregui is a Los Angeles based food blogger. His blog Food Bloggers Unite! is a one-stop resource for beginning food bloggers that focuses on food photography.

Read more from our Post Production category

Guest Contributor This post was written by a guest contributor to dPS.
Please see their details in the post above.

Become a Contributor: Check out Write for DPS page for details about how YOU can share your photography tips with the DPS community.

Some Older Comments

  • Samuel Burns May 12, 2013 10:31 am

    Thanks for sharing, I shall have a play with your techniques and see how it goes.

  • Christopher Jack September 21, 2012 08:56 pm

    Today Color Cast Correction has been universally used because it has never been this simple as it is now.

  • IainC January 11, 2012 06:40 am

    As some posters have observed, the grey point determination using a 50% neutral grey layer set to Difference Blend Mode, doesn't seem to make sense - although it may produce an image that is judged as 'better'. Even so, this method is replicated on many websites.

    To investigate this, here is what I did: I photographed a Grey Card in RAW (so that I could alter the WB & Exposure on my pc), then I processed the image, in Photoshop, through Camera Raw. I set the WB dropper (in Camera Raw) on the grey image and then opened the image in PShop; the grey read correctly (at 128/128/128), and a neutral grey layer in Difference Mode turned the grey to black (as it should). So far so good. I then went back to the original RAW file in Camera Raw and change the WB slider to some other color temperature to give the image a color cast. Opening this in PShop with the 50% neutral grey layer method, the color of the grey card darkened, but it did not turn to black (because the underlying color was not 50% grey - it was tinted (i.e. the RGB values were unbalanced)). Further, I then repeated the Camera Raw process, but, this time, after clicking the WB dropper on the grey image, I changed the Exposure before PShoping with the 50% layer: again it didn't produce black pixels.

    My conclusion: unless I know a neutral grey object in the scene (or have photographed it with a grey card or a Macbeth ColorChecker present), the 50%-neutral-grey-layer-difference-blend-method is at the mercy of any color cast or how the image is exposed and won't actually work.

    There are different methods to remove/alter color casts. I seriously recommend Katrin Eismann's 'Restoration and Retouching'. She doesn't mention this 50% Neutral Layer trick. ;)

  • Ohno July 1, 2010 09:30 pm

    I dont get it.
    You find a pixel that is grey - it has no color cast.
    Then you define it as beeing grey.
    Why should this step make any difference to the picture?

    What you wanted to do is tell the program what should have been grey, not what is already grey.
    Unless grey is always grey no matter what color cast you have?But how do the program then know the difference from one picture to the next?

  • SMiGL December 21, 2009 10:58 pm

    Great post. Thanks!

  • Landscape Prints July 7, 2009 12:46 pm

    Thanks, your article is a fascinating read on colour correcting those annoying colour casts. Perhaps taking a pic of a colour chart before the other pic would help to take eyedropper readings with true white/black and neutral grey in the chart?

  • pixel hunter June 12, 2009 07:34 am

    Think it thru. If you find a grey pixel and click on it, it is set to whatever the middle eyedropper is set to (default or custom setting).

    Now, the problem with this method is that you find a pixel that is CURRENTLY grey. This may or may not be the pixel that SHOULD be grey. What needs to be done is to find a pixel that you know should be grey

  • PMLPhoto June 10, 2009 09:09 am

    @guarana Not sure I quite understand - do you fade the opacity if the levels layer after clicking on (and then deleting) the blured copy of the image? Once you move to doing it by eye though (also carlos garcia's comment), there are plenty of ways, the ideal is to find an automated way though. So far, only shooting a grey card seems to do that.

    @daniel You can try layer masks to selectively apply corrections, but Ive never been happy with the results. Better to embrace the colour shifts and add some geled lighting to get the final result you want.

  • guarana June 10, 2009 06:45 am

    > PMLPHOTO: I agree, there's no fail-safe approach, though the techniques mentionned are giving me very good results (even with heavy color cast). Even with a blue sky if you play with the correction opacity (either one, match color or levels adjustment) it works good enough for me :)

  • Carlos García Illarxe June 10, 2009 05:24 am

    I'm using the command "Layers" but using the red, green and blue histograms. First duplicate the layer and then move the controls of each of the layers. At last, you can darken or brighten the final image with the middle control.

  • Daniel June 10, 2009 03:59 am

    Can just agree with everyone that question the soundness of this guide. The reason why it works most of the time is that most of the time you "know" where you have neutral grey and click there.

    But the $64,000 question is rather, how to white balance an image which has multiple light sources with different color temperature (e.g. incandescent or fluorescent + window light)!

  • PMLPhoto June 9, 2009 06:50 pm

    @guarana Does this appraoch only work if the image is reasonably neutral in colour overall. Say it was an image that was dominated by blue (blue sky and blue sea with maybe a model), then the blured copy would be pretty blue and the levels adjustment would adjust the blue to be a neutral grey which isn't the right answer I think :)

    I've pretty much come around to the idea that ther are no fail-safe shortcuts for this, and the only way to get it right is to do it right and shoot a grey card.

  • guarana June 9, 2009 12:50 pm

    weh, that wasn't clear :P

    let me rephrase:
    technique 2: duplicate your PHOTO layer, apply ‘average blur’ filter on the PHOTO COPY layer, add a ‘levels’ adjusment layer, pick the blurred PHOTO COPY layer as the neutral color. The PHOTO COPY layer should look gray. Delete the PHOTO COPY layer. The LEVELS adjustement layer will color correct you original PHOTO layer. (adjust opacity of adjustement layer to taste)

    it almost looks complex but it actually takes 5 seconds to do

  • guarana June 9, 2009 12:45 pm

    what I use:

    technique 1:
    image adjustment, color match, check 'neutralize' and voilà. And you can mix before and after with the fade slider and correct some more with the other sliders.

    technique 2: copy layer, apply 'average blur' filter, add a 'levels' adjusment layer, pick the blurred layer as the neutral color. The layer should look gray. Delete the blurred layer and the levels adjustement layer will color correct you original photo. (adjust opacity of adjustement layer to taste)

  • Samo June 7, 2009 08:45 pm

    I was excited by the title but as some replies already mentioned it's not really precise. If what Danny is saying would be true then you could simply paint some 50% gray (r-g-b=128) on seperate layer, use levels or curves picked that 50% gray and it would be done. But this does absolutly nothing. As Tyler Olson already said and is visible in step 3 picture, the color you marked as black was not exactly black therefore gray was not exactly gray on picture. That is what made difference in this tutorial.

  • gabLhowe June 6, 2009 07:47 am

    I managed to get until the step where you get the black pixel (using the threshold method, really helped a lot! thanks). Then, I labelled the points of black pixel, removed the 50% gray layer, opened a level adjustment layer, middle eyedropper, aligned crosshair and clicked... and nothing happens, or rather, nothing has changed.

    I'm quite unsure if I did any of the steps wrong, can anyone point out (except for being that the method itself doesn't work)? I compared my original image w the one after, and seems like it remained totally the same.

  • Reznor June 6, 2009 12:10 am

    I really think, TJ is right, this method doesn't work. You look for a 50% gray in a picture that has shifted colors. So the gray you find is not 50% gray in real life. If you use that as a source to correct your color, you'll just make it worse and introduce more cast to the picture. If this method actually worked, there would already be a filter that identified 50% gray pixels and used them to correct colors. But since those gray pixels are corrupted by a color cast themselves, it's not possible to correct a picture with this method. The result may look better than the original but it's still not correct white balance.

  • WIlliam Rackley June 5, 2009 11:52 pm

    thank you! great technique.

  • jojaspi June 5, 2009 11:49 pm

    I've seen (and participated in) this discussion over and over again.
    I agree with tj and others that theoretically this method can't work. If you can find a totally black pixel in the difference layer and mark that to use it as neutral grey, the only thing you accomplish is that you change pixels with RGB 127,127,127 into ... pixels with RGB 127,127,127. No color cast correction at all.

    At the same time, sometimes I use this method to reduce a color cast, and a lot of times it gives a good starting point (But not always!).
    That's not because you define 50% gray TONE as 50% NEUTRAL gray, as Danny States. That's not how a difference layer works.
    As Ron Bigelow (in his excellent tutorial on states: In each channel, the Difference Blend mode subtracts the blend color from the base color and takes the absolute value of the difference to create the result color.
    In other words: only a pixel with RGB 127,127,127 gives a pure black pixel with the difference layer.

    I Think most of the time this method works reasonally well is because a picture with a real color cast most of the time doesn't have pixels with RGB 127,127,127.
    So what you do (especially when you use the Treshold method) is define the pixel that is the nearest to RGB 127,127,127 as Neutral Grey.
    That can give an even worse color cast, but a lot of times it gives a better picture...

  • PMLPhoto June 5, 2009 11:24 pm

    I saw this appraoch described originaly in one of Scott Kelby's books. It does sometimes help with colour balance, but I share the confusion expressed by a couple of posters above as to how it works. If we imagine a 50% grey item (where R=G=B=128), and further we imagine the item lit by a non-white light source, then it will appear to have a colour cast. When we overlay a 50% grey onto an image of the item which includes the colour cast, then set the blend mode to difference, then the item will not look black as the image actually isn't grey (due to the cast).

    I did a little experiement that others might like to try - I photographed a scene that included a 50% grey card in RAW. I deliberately introduced a colour cast by setting an incorrect WB. When overlaid with a 50% grey layer with difference blend mode selected, the grey card was not the blackest item in the scene as checked using the threshold tool.

    I'd be very grateful if anyone could shed some light onto how the method works, as I can't work it out. It'd also be good to hear of others' tests.

  • Uli June 5, 2009 10:53 pm

    Sounds great, and I have tried to apply this technique on one of my pictures, but I couldn't find a single pixel that is completely black (RGB values 0/0/0), because even the darkest pixels have color casts.

    And why does it have to be a BLACK pixel anyway? Isn't it supposed to be 50% GRAY?

  • Chris Biele June 5, 2009 10:47 pm

    This is a great tip which I had seen once on Macworld. Scott Kelby explains how to do this with the curves command (your choice really) and throws in a tip on how to mark your spot in step 3 very easily.

    Thanks for sharing and here's the link: BTW, it's a 2 page entry...

  • Vash June 5, 2009 05:48 pm

    Nice tutorial, useful in many cases. For those that see a yellow/green tint in the second image, it's in all probability the monitors settings that make it look like that. Carefully calibrate your monitor and check again. In my monitor the first image clearly has a huge blue cast all over the place, while the second is white.

  • Max June 5, 2009 02:56 pm

    This is a great tutorial. Simple and very useful! Thanks!

  • Danny@FoodBloggersUnite June 5, 2009 12:07 pm

    Thanks Eclipse...makes this tip even better!

    To remove the eyedropper marker hold down the Shift + Option key and click on the marker.

    I think the logic behind this method is one that is based on using a neutral gray card and color balancing off of that....only in this tutorial you find the gray within the image....same logic though.

    I'm glad many of you enjoyed it!

  • Jenn June 5, 2009 09:41 am

    Brilliant. I found this technique with the black eye dropper, but was trying to locate some black pixels by eye. I didn't realize they had to be purely black, I was clicking on areas that SHOULD be black but might be a little blown out and then the adjustment would be off, or occasionally I would get it right. This seems much more precise and accurate, and very simple to do, only adding a few moments to the workflow once you got used to the process. Thanks for sharing, very clearly written, too.

  • Sandro June 5, 2009 08:36 am

    Simple and effective method for correcting color casts. Nicely done.

  • Daniel June 5, 2009 08:07 am

    I tried this on several photos and it works like a charm.

    I do find it hard to tell which is a better image though. On one screen, your after photo looks, slightly green, but on another it looks wonderful.

    I guess I need to fine tune some monitor settings ;)

  • Maggie June 5, 2009 07:59 am

    I'm seeing the same as andre. The after image looks yellow and the before looks much better.

  • Eclipse June 5, 2009 06:46 am

    Karthik is talking about after you add the 50% grey fill layer and change the layer blend mode to difference. You then create a threshold adjustment layer and mover the slider to the left. This gives you a clear distinction between all the other colours and the 50% grey tone you are looking for. You can then mark the spot and continue on your workflow from there. HTH

  • Donna Luker June 5, 2009 06:08 am

    I use this method with the added Threshold layer as well. See step 4 in this tut...

  • Alex Solla June 5, 2009 05:02 am

    After reading Danny Jauregui's post today in I just had to say.... this post is just phenominal in both its simplicity and the enormity of what it fixes. Granted, there are lots of ways to color correct images, but this is just about perfect. I am wondering next if there is a way to apply these white/grey balance settings to further images shot at the same time!

  • Steve June 5, 2009 05:00 am

    Terrific tip! I am just starting out with photo editing (CS4) so I am probably missing something - I don't know how to eliminate the 50% gray scale marker before saving.

  • Carlos García Illarxe June 5, 2009 04:47 am

    Sorry, this is one of the better tips I have found here! This is the best photographic learning site at far, I have found. Go on.

  • Carlos García Illarxe June 5, 2009 04:44 am

    You forgot to show the info palette, it's better for searching, if not a pure black, a neutral pixel, when RGB values are similar. I couldn't find R 0,G 0 ,B 0 pixel. Is this impossible?

  • Marcus June 5, 2009 04:23 am

    I've found that I've had better results using curves instead of layers adjustments because you can fine-tune your adjustments if you can't get the gray point just right.

    For a more thorough tutorial, I recommend Scott Kelby's method (which is very similar to what is described here) in The Adobe Photoshop CS3 for Digital Photographers. He has other editions for other versions of Photoshop, but I haven't looked through them. I'd imagine the tutorial is copied across editions and updated for versions.

  • David June 5, 2009 04:23 am

    This is a great simple and precice method.

    I have one question though do I get rid of the crosshairs marker left behind on the final image?

    thanks for a great tip.


  • Brigit June 5, 2009 03:39 am

    Ahhh- that makes sense! Thank you for sharing this, I'm off to try it out!

  • TJ June 5, 2009 03:33 am

    My intuition tells me this isn't quite right. I am not sure this method would correct colors accurately. I think it has the potential to introduce more errors than corrections. Here is my logic. Lets say you take a picture using florescent light with additional light bouncing onto the food from colored walls. Your 50% gray in that photo would really be some other color with the fluorescent light and the light from the colored wall added to it. So the 50% gray found in photoshop using this method would really be some other color with an error to make it appear 50% gray. When you select this as neutral gray, you shift all the colors with this error. I am an amateur and may be way off base, so please correct me if I am wrong.

  • Anna June 5, 2009 02:42 am

    This is great advice! I DO have that problem often and its frustrating. I have done the curves adjustment with the gray dropper before but I always had to search for the right gray in the photo by eye, and then test different grays to try to find which one was really the right gray ... after a while I tend to go nuts. This is much more precise and simple.

  • RICK June 5, 2009 02:38 am

    This is great! I shgot in some strange lighting sometimes and this will really help correct those nasty color cast I get.

  • Tyler Olson June 5, 2009 02:22 am

    Maybe I am blind too but I agree with Matt.

    The only pixels that are going to turn out RGB 0,0,0 black are pixels that are grey. That is to say 125,125,125 grey. So if you are accurate in your clicking, you will select this pixel and then define it as the grey point and nothing in your image will change.

    The reason it worked on this image (I am guessing) is because you found an area that was almost black, around RGB (3,3,30) and clicked on it. That spot had a blue cast as seen by the 30 so making that middle grey would take that away. Had you actually found a spot that was RGB (0,0,0) your image wouldn't have changed.

    This method helps to find a spot in the image that is currently the closet to RGB (125,125,125) but that doesn't mean it was RGB (125,125,125) in real life.

  • Andre June 5, 2009 02:18 am

    Have you got the images reversed? The 'after' image seems to have a slight yellow cast to it. I think it looked better before.

  • Danny@FoodBloggersUnite June 5, 2009 02:03 am

    Danny again..

    Karthik, could you elaborate on this shortcut...I'd love to find a way to make this even easier!

    Andy, I'm not a lightroom user so I have no idea if it will work. Anyone have an idea if this can work in lightroom?

  • Danny@FoodBloggersUnite June 5, 2009 01:57 am

    Danny here...

    Matt, You first find a pixel that is 50% gray TONE, then define it as 50% NEUTRAL gray...defining it as such will shift the rest of the color spectrum and neutralize any cast. Hope that clarifies.

    I'm glad readers like this tip. It really has saved me so many headaches when correcting casts.

  • Scott June 5, 2009 01:28 am

    I saw this done in a much longer way once, but your method was very well done and clear as glass. thanks a ton!

  • puhi June 5, 2009 01:27 am

    very nice, simple, clean procedure. thanks for this one!

  • Andy June 5, 2009 01:08 am

    Great tip, especially for someone colorblind like me.

    However, is there a way to do this in Lightroom without having to go into PS?

  • Karthik June 5, 2009 01:04 am

    In step 3, you can use threshold to find the black point instead of having to do it by eye. easier that way :)

  • Matt June 5, 2009 12:58 am

    I'm missing something. You found a pixel that is gray, then defined it as gray. Why did something change? I would understand this if you could use the fill layer/difference technique to find something that was neutral gray in the scene, but we're talking about a gray pixel.

    Help me out here.

  • The Wallbanger June 5, 2009 12:53 am

    Brilliant! Thank you so much. I have a library of photos I could use this technique on.

  • Ilan June 5, 2009 12:52 am

    Simple and effective.

  • Quck Photography Tips June 5, 2009 12:51 am

    That's a great tip. Color casts can be so hard to remove by eye. Much better to do it by calculation.