Color Cast Removal

jjbongjjbong Registered Users Posts: 244 Major grins
edited March 15, 2011 in Grad School
I'd like to start a discussion of ways to correct color casts, as this is an issue I have in virtually every image I shoot. I use a WhiBal card, and this gets me in the neighborhood, but rarely does it solve the problem completely.

Many images have casts whose intensity varies with lightness, and they are typically stronger in the darker parts of the image. Other images, typically but not exclusively those shot in artifical lighting (especially multiple types of lighting) have crossing casts, where both the color and intensity of the cast varies throughout the image. I usually shoot out of doors, so I rarely see this type of cast.

I use a variant of [thread=184713]Dan Margulis' Picture Postcard Workflow (PPW)[/thread], in which the first step is elimination of any cast. The last step is color enhancement in LAB, and any residual casts, even small ones, will be amplified to an unpleasant degree. My usual method to remove color casts is to use an RGB curve in color mode, with sample points in the image which are either neutral (so I'm going for roughly equal R, G, and B values) or which have a noticeable cast (usually a cold one, blue or green, and where I'm looking for positive A and/or B values in a LAB info palatte).

Here's an image I shot under less than perfect conditions (the egret decided to get between me and the sun):

1208286564_3bLHe-X2.jpg

This is right out of the Camera Raw, with no changes. Pathfinder has the raw image, if anyone is interested in that. The blue cast in the shadows of the bird is evident, even without looking at the info palette.

One way to remove a cast is to set the White Balance in Camera Raw by using the White Balance Tool. In fact, this is how you use a WhiBal card. But you could just as well use the Tool on any neutral part of the image, such as virtually anywhere on the bird's feathers in this image. I tried to do this, and it did a pretty good job, but I was always left with some parts of the bird that were either green or blue. So I did the best I could with the White Balance Tool, and tried my usual method of an RGB curve in color mode. This is the curve:

1208285884_Uf3pB-O.jpg

And this is the result:

1208284974_oRU39-X2.jpg

It doesn't look too bad from a color cast perspective, but there are residual blue and green casts on the bird that I couldn't eliminate with curves, and some areas are too yellow. This is the result after the PPW Luminosity step, and you can see the unacceptably yellow areas:

1208286256_tXXLU-X2.jpg

The blue and green residual casts would come out later in color enhancement. Looking at the some of the problem areas with the info palatte, I could see why curves wouldn't work. There were blue casts in areas with similar RGB values than areas with green casts. There's no way an RGB curve will handle this situation.

In Dan Margulis' last set of Kelby online classes, he presented a technique for correcting crossing casts that's both simple and powerful, and I attempted it here. For reasons that will become evident later, I didn't want to correct very much in Camera Raw, so I used the White Balance Tool on the highlight in the bird's feathers, leaving a strong blue cast in the shadows.

The technique is simple:
1. Go into LAB with a flattened image
2. Add a copy of the layer in Color Mode, 50% opacity
3. To the top layer, do Image->Adjustments->Invert

You end up with these layers:

1208283592_jUeeW-O.jpg

What's happening is that the Invert causes all of the channels to go upside down, light becoming dark, green becoming magenta, etc. Since the layer is in Color mode, it doesn't affect lightness, but only color. So the Invert causes all of the colors to go to their opposites. Since Opacity is 50%, it kills all of the colors to neutral. Here is my result:

1208314264_KG6u6-XL.jpg

The thing is, you don't need to understand how all of this works in order to use it. Think of it this way. The upper layer kills color, driving it to neutral. The color still exists in the bottom layer, so you want to control where the color is killed, and by how much.

In this image, I want to limit the effect to the bird's feathers, and that turns out to be easy. In this image, the only thing that's blue (negative in the B channel) is the cast on the bird. There are also some areas of a slight green cast, and these are the only areas in the image which are green (negative in the A channel). So I use the Blend-If sliders on the top layer to apply that layer only to areas where the bottom layer is negative in the A or B channel. The sliders look like this:

1208285697_chmyK-XL.jpg

And the result is this:

1208285220_nd7hK-X2.jpg

The cast on the bird is completely gone.

This was an easy image for this technique. In other images, you could limit the effect of the top layer by using a mask. Often a mask can be created from the A, B, or a combination of A and B channels. It might have to be curved, and if it were derived from the A or B channel it would have to be Auto-Leveled. Adjusting the opacity of the layer can also help in some cases.

After removing the cast, I did the usual Luminosity and Color Boost steps of the PPW.

For Luminosity:
1. Go back to RGB with a flattened image
2. Copy the bottom layer in Luminosity Mode
3. Curve the Green and Red channels to lighten and increase contrast in the darker parts of the bird
4. Shadow/Highlight

For Color Boost:
1. Very steep A and B curves at very low opacity (17%)
2. Less steep A and B curves at low opacity. These usually go exactly through the origin of the graph, but here I steepened the B curve slightly to warm the image up a bit.

Sharpen and done:

1208285844_ACR52-X2.jpg

Anyway, I'm interested in how others would approach the color cast part of this.
John Bongiovanni

Comments

  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 7, 2011
    I have been waiting to see how you were going to handle this image. Well done!

    I will try to get my response up in a few days.

    If folks want to join in, I will put the RAW file online in my public gallery -- https://public.me.com/path_finder
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
  • MarkRMarkR Registered Users Posts: 2,099 Major grins
    edited March 7, 2011
    It's a good image to try out color balancing techniques. The "done-in-one" Auto Color button will often get in the right ballpark, but fails miserably on this image, making the cast *more* blue.

    The "Do-in-two" button, the usually reliable Match Color| Neutralize, also blues things up. :(

    Here's my one-minute attempt using ColorWasher, a relatively inexpensive plugin that does a nice job with strong or strange casts:

    1209403183_5iadM-L.jpg

    I think it did a creditable job myself. I created two selection boxes, one for the body and one for the neck for ColorWasher to select. I also had the Sat. Fix button on to help tame the grass color. I didn't do anything with tone, so it's a bit flat, I was mainly working on the color cast part of it.
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 9, 2011
    MarkR wrote: »

    I think it did a creditable job myself.

    I'm not so sure. The tail and neck are still pretty blue. The background is pretty yellow for my taste, but that's a judgement call. The blue in the bird is not, however.
    John Bongiovanni
  • MarkRMarkR Registered Users Posts: 2,099 Major grins
    edited March 9, 2011
    You're right about the blue. I'm going to try again with the raw file, my initial attempt was with the version posted, which may not have had enough data for CW to work with. As to the grass, you were there, I wasn't. I am more used to seeing yellow grass than red, but that might be because I live in Rochester, NY. :D

    EDIT:
    Actually, using Colorwasher, I can then move into Lab, write a quick curve to kill the blue in the bird, and still keep the grass green-yellow. I will post tonight if I have a chance. Could probably do the same thing with a quick RGB curve, if I was better at it. :lol

    EDIT EDIT:

    And then there's a whole discussion about why we're doing this. OK, we killed the cast. So what? Does it make the image better (match the vision of the artist), or are we just killing the cast to see if we can? Personally, I would find my posted version more pleasing than your version, even if you were more effective at killing the cast. But I'm not the artist, or the client.

    EDIT EDIT EDIT:
    Used the raw, WB on highlight of the bird. Used ColorWasher to remove most of the cast. Used L*a*b* to remove the blue cast from the neck and wing by a minor tweak to the b* channel.

    [IMG][/img]1210956210_p2KwK-L.jpg
  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 9, 2011
    I cheated here and let John go first, and that gives me a target to compare to. Not fair, really, but I think I have an alternative way to process this file.

    Let me start, by saying that color balance is up to the creator of the file, that there is no "real true" color, just the color desired by the editor of the file, as dictated by their artistic tastes or sensitivities. "Flame suit on"

    When I opened the Heron file, John snailmailed me, in Adobe Camera Raw 6+, I was surprised to find it was shot with a 200-800mm zoom lens!!?? I went out to Google to see where I could find a lens like this, and did not find one anywhere. When I later opened the file in LR3, it told me that the file was shot with a Canon 100-400 and a 2xTC which made more sense to me, and demonstrated the funny particulars of ACR versus LR ( which Adobe tells us are the same exact engines )

    1211346200_NMSzM-X3.jpg

    I have decided to process this file in LR3, rather than ACR because I prefer the interactivity allowed by the History palette on the left tab of LR3, over the "no history palette" approach of ACR. I can then just do screen grabs from LR3 to show exactly what I am doing as I go through my workflow.

    The first think I noticed is that the file was being processed with a 2003 camera profile, and a Custom color balance setting of 5250 and +7 Magenta I noticed green margins along the back of the heron due to chromatic aberration as well..

    The first thing I did was switch to a 2010 Camera profile, and after playing with the color balance tool looking for neutrals, I decided I really liked the Shade setting the best. Now, there is no right answer here because the back of the heron is clearly sunlit, but the side is obviously lit by blue sky, and the heron is surrounded by the warm reddish brown grass that reflects off its underside. Rather than trying to follow John's approach of neutralizing colors, I decided to embrace them by using the Shade setting. This corrects the blue on the heron's side nicely, and creates a nice warm sunlit appearance to the heron's back, like a late afternoon sun, not a sun at noon. This also warms the foliage as well. The heron no longer reads as a neutral white, but a warm reddish tone, but that is ok to my eye in this warm late afternoon image.

    1211346642_pjsoC-X3.jpg

    Next I worked through each of the Raw processing tabs in the right column of LR3. Shade -> 7500, + 10 magenta

    I then worked through the Exposure, Recovery, Fill, and Black sliders, and decided I wanted the image a bit brighter so I raised the Brightness to 54. Gentleness is the ticket with Brightness.

    I added some Clarity and Vibrance as seen in the image of Lightroom, and left the Tone Curve as Medium, hence it is not displayed in the image. HSL/Color, Split Toning, were not altered from default.

    The values I use for Sharpening and Noise Reduction are values I find I use quite frequently, I should make a preset with them I think. Sharpening Amount 70, Radius 1.0 unchanged, Detail 28, Masking 47 ( could even go higher ).... Noise Reduction I raised the Luminance slider to 10, and the Color slider to 34

    I used the Brush Tool to add a bit of saturation and increased luminance to the yellow on the bill and the left leg.

    I enabled the Lens Profile for the Canon 100-400 default and found this removed the green line along the superior margin of the Heron's back.

    And I was done with the Raw Processing of this DNG with this result...

    1211346492_P3qBm-X3.jpg

    Here is the file as exported from LR3

    1211366638_d7FvC-X3.jpg

    This image has not been processed in Photoshop in anyway. I can see flaws with it - it does have a blue band along the upper shaded area, but I am uncertain still if this is bad or not. The feathers of a heron have no pigment, but are millions of tiny specular reflecting mirrors, and hence, like snow reflect the color of their environment. Which in this case is blue sky, warm yellow sun, red brown foliage from below.

    I will pause at this point to allow viewer's to render their opinions of my Raw processing and color balance.

    My final edited jpg in full size is available here - http://pathfinder.smugmug.com/Other/Large-files/1789718_YdTAs#1211366638_d7FvC-O-LB
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
  • MarkRMarkR Registered Users Posts: 2,099 Major grins
    edited March 9, 2011
    Pathfinder, of all the shots you posted, the one that looks most pleasing to me is the second one, or possibly the third, which looks the most "natural" to my eye. (the one which only has camera raw tweaks.) I'm a little unclear about the transition between the 3rd and 4th images you posted-- why do they look different? Or is it just a trick of the eye caused by the black Lightroom border in the third image?

    I believe John has probably killed the cast most effectively, but I'm not sure if the final result is as pleasing to my eye.

    I might have a better test image for color cast removal, because it is an image that was shot under tricky museum lighting, (no flash, no tripods, dim area) and which relies on the contrast between clean white walls and bright green colors to meet the artist (my) vision, modest as it may be. Let me dig up the raw and I can post a jpeg from raw either here or in another thread, time permitting.
  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 9, 2011
    Mark, the third and fourth images should match - one is a screen capture from my Mac, and the other is the jpg exported and saved from Lightroom. As I said, the exported jpg is only from the RAW editor in LR, it has not been editied in any way in Photoshop, and it certainly could be if needed.

    When I go to my Smugmug gallery the screen captures do not seem to have an sRGB profile whereas the final exported jpg is certainly exported from Lightroom as a 8bit sRGB file - i think that explains the different colors between the 3rd screen capture and the final exported image. I thought the screen captures would be sRGB tagged but I see that is indeed not the case.

    Mark, I do agree that John has done a better job of neutralizing the casts in his image. I just am not sure that I like it better than mine, and I am waiting to see how the readers vote their opinions.

    Do not place great emphasis on the screen captures, their color will not be completely accurate, but they do allow readers to see my EXACT editing steps as I worked through the image.

    Let's have a separate thread for your image if you will please.
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
  • MarkRMarkR Registered Users Posts: 2,099 Major grins
    edited March 9, 2011
    Boy, I really twisted my words up in my earlier post. Should be "I'm not sure if the final result is as pleasing to my eye." I think I got lost in all the double negatives. :D

    I will edit it in a second.
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 9, 2011
    MarkR wrote: »
    I might have a better test image for color cast removal, because it is an image that was shot under tricky museum lighting, (no flash, no tripods, dim area) and which relies on the contrast between clean white walls and bright green colors to meet the artist (my) vision, modest as it may be. Let me dig up the raw and I can post a jpeg from raw either here or in another thread, time permitting.

    That would be great. Exactly the kind of discussion I wanted to start.
    John Bongiovanni
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 9, 2011
    MarkR wrote: »
    And then there's a whole discussion about why we're doing this. OK, we killed the cast. So what? Does it make the image better (match the vision of the artist), or are we just killing the cast to see if we can? Personally, I would find my posted version more pleasing than your version, even if you were more effective at killing the cast. But I'm not the artist, or the client.

    Excellent question, and I'm in total agreement that what we're trying to do is make the image match what we saw, achieve a particular vision, etc. Removing a cast is a technique that may (or may not) help in this process. And I do admit that the residual casts in your posted image are not readily noticeable, so my critique here was entirely technical. Putting all of this aside, I actually like your bird, although I don't like the background. But this is subjective (and, as you point out, geographic).

    My particular interest in removing the cast derives from my workflow, which is a variant of the Dan Margulis PPW (referenced earlier) and involves some rather drastic color boosts in LAB as the final step. If you go into these with a cast, the cast gets amplified to generally unpleasing results. So that's where I'm coming from on this, a somewhat narrow focus.
    John Bongiovanni
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 10, 2011
    I like your result, Jim.

    I spent a few minutes in Bridge, flipping back and forth between our two images and trying to decide which I liked best, and I couldn't decide. Each has something different to offer. In some earlier "competitions", I thought yours were decidedly better, but here I'm not sure, but I also don't think mine is decidedly better.

    As you mentioned, you went down a different path than I did, wanting to take advantage of the colors and enhance them, reflecting them in the body of the egret. I was focused on eliminating the, to me, impossible colors in the egret's feathers, and then getting the best image.

    Two things about your image bother me, though. One is the blue that you pointed out near the tail. When you're training yourself to look for casts in your images, you become sensitized, and this really jumps out to me. Unlike Mark's image, where I had to use to Info palette to see the blue, I could see this with my own eye. It just seems out of place to me, there being nothing blue remotely near. The other, which is perhaps unfair because we're focusing on color and not contrast in this discussion, is that I don't think the detail in your image is as good as that in mine.

    Unfortunately, being Lightroom ignorant, I couldn't follow how you did the color cast removal, but I got that you were able to translate your intent into practice, and that's what matters.

    I am impressed with what you're able to do the the various lens profiles in ACW. I'm several versions out of date in PS.
    John Bongiovanni
  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 10, 2011
    I think we both approached this bird from different vantage points, and came significantly closer together than the initial image.

    I agree that I am not certain I like that blue swatch near the tail in my edit, but this was merely Raw rendering, and the blue could be removed in Photoshop in a number of different ways - selecting Highlights and desaturating the Blue channel will probably remove it easily and might be my initial attempt. I think the blue swatch is reflected from the sky, which while not near in the image, is pervasive in the birds environment.

    I agree that you have better contrast/detail in the white bird feathers. I di dnot sharpen as hard as I might have or that I would for printing. A bit steeper luminosity curve in the highlights might help here in my image, in Photoshop.

    Do you think your bokeh along the superior margin of the out of focus background is just a bit harsher than in mine, perhaps?

    I did not remove a cast, so to speak in LR, merely chose a different white balance - Shade. I usually do not like the Shade setting, but did in this case, since most of the image is actually in shade, I think. Certainly Sun would be the wrong balance point for the majority of the image.

    I notice near the rear most inferior portion of the bird, you have the same reddish tones in the white feathers I do, reflections from the grass I think.
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 10, 2011
    pathfinder wrote: »

    Do you think your bokeh along the superior margin of the out of focus background is just a bit harsher than in mine, perhaps?

    Yes, I had not noticed that earlier, but I agree.
    I did not remove a cast, so to speak in LR, merely chose a different white balance - Shade. I usually do not like the Shade setting, but did in this case, since most of the image is actually in shade, I think. Certainly Sun would be the wrong balance point for the majority of the image.

    Ah, I get it. Which comes back to another question. It's been my experience that setting white balance alone, however it's done, is frequently not sufficient as the cast (or proper white balance) varies in the image. And I'm not talking about crossing casts due to radically different light sources, but shots in daylight such as this one. Is that your experience also?
    John Bongiovanni
  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 10, 2011
    Most out of door shots always have some areas in sunlight, and some in shade, and hence different color temperatures within their boundaries. This is not inherent to digital, but was true in the days of Kodachrome as well. We used to see it, but just ignore, or not recognize it, or maybe left it to Kodak to resolve. I find I go through this same thought process in my own images, and ultimately have to decide which is more important, sun lit or shaded.

    As I touched briefly earlier, what is the color of a heron? I think it is like snow, the color of whatever light is shining on it, whether daytime sunlight, shade ( blue sky light actually is what shade is ) , or even red from a nearby barn, or green from surrounding vegetation. If you ever shoot a bride on a golf course you will know that her pure white dress IS green in the reflected light from the grass. SO what color is a heron? Not always a pure white that is for sure, but finally the color the photographer/editor decides looks right to his/her eye. Correcting casts can be beneficial, but if you correct the cast of a low afternoon sunlit scene, you will ruin it. It is the warmth in the color tone that makes it, frequently.

    I think significant color casts more usually are caused by combinations of crossed lighting; sunlight with tungsten, or tungsten and a little fluorescent, or filtered tungsten, or even sunlight reflected off a wall - whether brick or stone or red rock.

    Think of a person standing in the shade where the sun shines on a red rock wall opposite the shaded area and you can have blue light on one side of the subject and red light on the other....Theoretically an Expo disc would give you an average color temp that will render grey -> grey, but a person may have blue on one side of their nose and red on the other in this situation. We need to see this in advance so we can correct it with a scrim before shooting I think.

    I am not sure I really answered your questions with my rambling monologue, John. Maybe our readers will give us their opinions as well.
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 10, 2011
    pathfinder wrote: »
    I am not sure I really answered your questions with my rambling monologue, John. Maybe our readers will give us their opinions as well.

    That's a nice explanation, Jim, and it explains a lot.

    But there's the difference between what we see and what the camera sees, and that's the objective of cast removal. Regardless of the grass reflections in the bride's dress, for example, we all remember it as white. Somehow we don't see the green reflection, but the camera does. Same thing for the heron.
    John Bongiovanni
  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 11, 2011
    jjbong wrote: »
    But there's the difference between what we see and what the camera sees, and that's the objective of cast removal. Regardless of the grass reflections in the bride's dress, for example, we all remember it as white. Somehow we don't see the green reflection, but the camera does. Same thing for the heron.

    That really is the issue isn't it. We don't "see it" although the camera does capture it, and hence we know it IS there, but cannot accept it in our prints on paper. Thus the goal of cast removal is to alter the actual correctly captured colors to hues that are more inline with our subjective memory???

    It really is challenging at times. When I first shot a bride on a golf course I was stunned by how green her dress looked in the images, and did not "see" the green at the shoot at all, although it obviously was there if you looked for it. A magenta filter would kill the green in her dress nicely.

    Folks tell me clouds are white and never green; I invite them to photograph the cumulous clouds over the cornfields in Iowa sometime.
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
  • jjbongjjbong Registered Users Posts: 244 Major grins
    edited March 15, 2011
    pathfinder wrote: »
    That really is the issue isn't it. We don't "see it" although the camera does capture it, and hence we know it IS there, but cannot accept it in our prints on paper. Thus the goal of cast removal is to alter the actual correctly captured colors to hues that are more inline with our subjective memory???

    I'd rephrase it slightly. The goal is to show what we actually saw, as the eye/brain work differently than a camera. I'm not an expert on this, but Google quickly provided me these examples:

    http://www.psychworld.com/optical-illusion-of-the-week-chromatic-adaptation-2011-01
    http://www.colorcube.com/illusions/chrmadptb.htm

    I have a real good example right outside our house. We live on a hill, looking out on an old, white hotel with a cupola that these days is lit with florescent lights. so at night the interior of the cupola looks pretty green from here. But where you're up there at night, it sure looks white.
    John Bongiovanni
  • pathfinderpathfinder Super Moderators Posts: 14,703 moderator
    edited March 15, 2011
    It all comes down to whether we believe what we "see" is reality, or what we image with a device is a rendering of reality, doesn't it?

    I sound like President Clinton I think.rolleyes1.gif
    Pathfinder - www.pathfinder.smugmug.com

    Moderator of the Technique Forum and Finishing School on Dgrin
Sign In or Register to comment.