custom white balance for IR using LAB

The problem

One thing that has vexed me as I begin to learn digital IR is the subject of setting a custom white balance. Since infrared filters such as the Hoya R72 that I use pass very little visible light, if I want to produce IR images with false color, the color present in the final image has to come from somewhere, typically from the small range of red hues allowed through the filter. Without carrying out a custom white balance, the entire image turns out in shades of magenta. Not surprising, but not very esthetically pleasing.


One solution

That’s where setting a custom white balance comes into play. The conventional advice with digital IR photography is to use your camera’s custom white balance (WB) feature, with the IR filter in place, to set the WB using a uniform field of green, typically green grass.

The tools I use are a Minolta DiMage 7 camera with a Hoya R72 filter, Adobe Lightroom and Adobe Photoshop PS2 on OSX. The issue I kept running into was that although I would set the WB using that approach, when I opened the RAW files in my current software tools of choice: Lightroom, or Adobe Camera RAW (ACR), the custom WB didn’t seem to stick. So I’d grumble, thinking that I was doing something wrong, move on and process the images using the best approaches I could come up with.

What set off the proverbial light bulb over my head (a light bulb with a nice tungsten WB) was a post by n6mod on the Infrared Photography Community forum describing his similar experience with setting custom WB. Fortunately, he went to the trouble of writing up a more detailed explanation, including sample images. Thinking about it, software applications such as Lightroom, ACR, and others probably shouldn’t automatically apply custom WB settings from the camera to RAW files, since that kind of defeats the purpose of a RAW file. They should, however, offer the option of applying the custom WB setting stored with the RAW file. As far as I know, they don’t. The “custom” WB setting in Lightroom refers to setting a WB value in Lightroom, and doesn’t refer to applying the custom WB value coming from the camera.

So what’s a person to do? One program I’ve found (dcRAW-X for OSX) does seem to offer the option of applying the custom WB value from the camera to a RAW file, and like n6mod’s examples, it seems to do it properly. But using a separate program like dcRAW-X doesn’t fit in well with my overall workflow. Working in RGB in Lightroom or Photoshop also doesn’t seem to do the trick, at least in my hands. And as n6mod has pointed out, using the available WB tools in programs like Photoshop that rely on a “temperature and tint” approach also doesn’t do a good job of replicating the effect of a true WB correction done in-camera.

false color IR LAB LOVE

Another solution using LAB (or, there’s more than one way to skin a cat)

Once I got some of my own images with the custom WB applied using dcRAW-X, I thought “I’ve seen color shifts like this before“. In LAB.

Using LAB color space to adjust the overall WB of a digital IR image won’t give exactly the same results as applying a custom WB from the camera. It couldn’t possibly. I doubt that any post-processing approach could match the results from an in-camera setting taken under the actual lighting conditions of the image, especially for something as extreme as the color shifts from using something like an R72 filter.

However, using LAB in PS2 gets close, and offers interactivity that does work well with how I work.

It’s not my goal to describe what LAB color is, I’m not even remotely qualified to do that. Let’s just say that it’s an alternative way of representing color to RGB and CMYK that are probably more familiar to many people. In short, LAB color separates out the color space into 3 channels, one luminance channel (L) which represents the brightness, and A and B channels which encompass the balance between green and magenta (A) and yellow and blue (B). It’s a weird concept to grok.

If you’re interested in a more detailed description of how to use LAB (over 300 pages worth), go get yourself a copy of Photoshop LAB Color by Dan Margulis. It’s been my main source of information about LAB color. It’s one of those rare books that takes a very technical subject, and distills it down to comprehensibility, without talking down to you or oversimplifying the subject. I’ve only read through about the first 2/3’s of the book, but I’m sure that I’ll be going back through it over and over again in the future. If you get this book through the link on this page, you’ll help make me rich (not really, but every bit helps).
Curves dialog in PS2 for LAB

Fig. 1 My cheat sheet of the PS2 adjustment curves for the 3 different channels in LAB (inspired by Photoshop LAB Color by Margulis). The colored boxes represent partners affected by each curve, and aren’t actually present in the PS2 dialogs. If they were, I wouldn’t need this cheat sheet.

A one (or two) minute introduction to LAB

So what does an image look like when you look at each channel separately in LAB? It’s not nearly as intuitive as looking at individual RGB channels. Let’s start with a nice colorful conventional photo (Fig. 2).

hot air at nightglow

Fig. 2 Inflating a hot air balloon at sunset at the Indiana State Fair.

If you look at the individual channels of this picture in RGB, you get about what you would expect, shown in Fig. 3. Each channel has a substantial amount of signal from red, green and blue, as you would expect for an image with a lot of color in it. The black areas around the base of the balloon has a lot of signal in each of the three channels.

red channel

green channel

blue channel

Fig. 3 This series of shots shows the red, green and blue channels (from top to bottom) of Fig. 2. About what we would expect and what we’re familiar with.

But what if we convert Fig. 2 to LAB and look at each channel individually? If we do that, the resulting channels (Fig. 4) look nothing like what we’re used to in RGB or CMYK land. We’re not in Kansas anymore Toto.

Luminance channel

a channel

b channel

Fig. 4 The separate L, A and B channels (top to bottom) from Fig. 2.

The L (or lightness) channel looks like what we would expect, considering it encompasses all of the luminance information in the image. This is one reason why a lot of people use LAB for converting images to black and white. But what is going on with the A and B channels? If we look at the A channel (the middle image in Fig. 4), you can see that the brightest areas are inside the balloon, where the red fabric is, and the darkest areas are where the green fabric is. If you look back at the cheat sheet in Fig. 1, remember that the A channel contains all of the red and green information from the image.

If you use the eyedropper tool on this image in LAB mode, you find that the solid red area of fabric has a value on the curve of about 33 and 33 for the input and output (Fig. 5), and the solid green area of fabric is closer to 64 and 64 for the input and output.

A curve with highlighted red and green areas

Fig. 5 The A channel values for the solid areas of red and green fabric in the interior of the balloon are highlighted.

So now the A channel makes a bit more sense. Areas that have a strong red color occur towards the lower left corner of the A curve, corresponding to bright areas in the A channel. Similarly, areas with a strong green color correspond to dark areas in the A channel. Areas that are in the middle of the curve, showing up as light gray in the A channel, have neither a strong green or red tint to them.

Of course, we’re forgetting the effect of the B channel on the image. In order for an area in the image to show up strongly red or green, there needs to be little contribution from the B channel (corresponding to blue/yellow), and if we look at the image from the B channel (the bottom image in Fig. 4) we find that the areas of bright red and green fabric have a neutral contribution from the B channel. You can go through a similar exercise looking at bright yellow or blue areas in the B channel.

Looking at either the A or B channels in isolation with the L channel makes it a bit clearer what is going on (Fig. 6). Once we include the luminance information with either the A or B channel, we can see that the L + A channels contain only red, green and luminance, while the L + B channels contain only blue, yellow and luminance.

L and A channels

L and B channels

Fig. 6 The effect of looking at the L + A channels (top) or the L + B channels.

So how do we use this for custom setting a WB with IR?

Enough with full color photography. How do we take advantage of this for setting a custom WB with digital IR? If you’re used to working in RGB, or CMYK, then working in LAB certainly takes a while to get used to, and it’s definitely not intuitive. I think it’s worth the effort though.

First, let’s take a look at what a custom WB does to one of my IR images. As I indicated earlier, most of my IR photography is done using a Minolta DiMage7 with a Hoya R72 filter. Images taken with other cameras and filters will look and respond differently, but most of what I describe here should apply.

Fig. 7 shows an original RAW file, with the overall magenta cast from the Hoya R72 filter. This image was opened up in Adobe Lightroom, then exported as a jpeg file without modifications.

original RAW file with R72 filter

Fig. 7 “LOVE” by Robert Indiana, on the grounds of the Indianapolis Museum of Art. No adjustments in WB have been made.

If we take the image and apply the custom WB information from the camera (set using a uniform field of green grass) using the default settings in dcRAW-X, we get Fig. 8.

custom WB using dcRAW-X

Fig. 8 Custom WB applied using dcRAW-X. The custom WB was defined in the camera by taking a picture of a uniform field of bright green grass. The default settings in dcRAW-X were used.

What does this image look like in LAB before and after applying the custom WB? Let’s take a look. We’re not going to worry about comparing the L channel of Figs. 7 & 8 since we’re interested in differences in color balance between the two, not differences in luminance or contrast. Let’s just compare the A and B channels between Figs. 7 & 8.

This comparison is what made me realize that using LAB color space could be very useful with digital IR. Figs. 9 & 10 show the A and B channels of Figs. 7 & 8, corresponding to before and after applying the custom WB provided by the camera using dcRAW-X. Even if you haven’t completely figured out LAB color space, what should be immediately obvious is that applying the custom WB from the camera with dcRAW-X eliminates almost all of the contrast in the A channel, apparently without having a major effect on the B channel. Bingo.

A channel before and after custom WB

Fig. 9 The A channel before and after application of the custom WB settings from the camera.

B channel before and after

Fig. 10 The B channel before and after application of the custom WB settings from the camera.

So how can we use this information to our advantage? Let’s open up Fig. 7 and apply a bit of LAB goodness. First we’ll punch up the contrast in the L channel by a bit. Then we’ll almost flatten the A channel, as shown in the middle curve in Fig. 11. This eliminates almost all of the contrast in the A channel, eliminating the magenta color cast coming from the R72 filter. This is similar to the net effect of what dcRAW-X did when it applied the custom WB from the camera, shown in the right side of Fig. 9. Tweaking the blue/yellow balance as shown in the right curve of Fig. 11 completes the LAB white balance.

adjusted curves in LAB

Fig. 11 Flattening the A channel is the main adjustment in LAB that brings the WB of Fig. 6 close to that obtained using the camera – supplied custom WB using dcRAW-X.

Fig. 12 is the result of adjusting the color balance in LAB on Fig. 7, using the simple curve adjustments in Fig. 11. Although it doesn’t completely replicate the results of applying the custom WB from the camera, using dcRAW-X, it comes close.


Fig. 12 The results of using the LAB curves in Fig. 8 to adjust the WB.

From this point, it’s just a short hop skip and a jump with the A and B curves in LAB to go from Fig. 12 to the final false color result in Fig. 13. I’ll go through additional false color adjustments for digital IR in the second tutorial, coming soon.

false color IR LAB LOVE

Fig. 13 The result of some final tweaking of curves in LAB.

There are a number of good discussions available that have influenced this tutorial. Check them out.

~ Fin ~

~ originally written Aug/07 ~

Comments, questions, suggestions for improvement? I’d love to hear from you.


7 Responses to “custom white balance for IR using LAB”

  1. Hi
    thx alot for the clarification. I stepped into this problem a few days ago. I’m still unsure what to do…
    – just shoot jpg?
    – shoot RAW without WB and then via LAB or Converter…?

    Do you have a Photoshop Action for this LAB thing? After a lot of playing my results are still a lot worse than with my “old way” of shooting JPGs.

    thank you!

    • Hi Philip,

      Thanks for the question. I don’t have a Photoshop action for this. In my experience it takes a lot of tweaking in LAB to get results that I find aesthetically pleasing, each image tends to be unique, so I’ve never bothered to put together an action in PS. After a bit of practice I find that I can get 95% of where I need to be in less than a minute or two, so it’s just not worth putting together as an action. One detail I didn’t include in this tutorial is that you should be doing everything in layers in PS, so that you can work non-destructively on the original image.

      It’s been quite a while since I’ve shot infrared, but my old Canon Digital Rebel is currently out being converted to a dedicated IR camera, so I’ll be shooting quite a bit more in the future. I’ll probably revisit this tutorial once I start shooting a lot more IR.

      BTW, I only shoot RAW, and worry about adjusting WB in post-processing. JPGs have much less color information in them compared to the RAW files, so if you’re shooting JPG you have to set a custom WB in the camera.

      • Hi again.
        Today I had an elightenment πŸ™‚
        I discovered the Adobe DNG Editor with Color Profiles
        At first you will have some nice new color profiles designed for your Camera – lots of Nikon+Canon Profiles in there (when importing RAW under “Camera Calibration” – I only had AC4 and 2 in there) but the best part is, that you can edit a profile in the DNG editor and change the white balance.
        For me WB -80 and Tint -20 worked great (it’s a different scala than in PS). Now when I open my “red” IR – I just use my IR Profile and the colors are perfect. No LAB, no external Program πŸ™‚
        Here the adobe Guide:
        And this is where I discovered the idea:

        Give it a try πŸ™‚

      • Good point, and thanks for reminding me of Adobe’s DNG Profile editor. I think I played around with it a bit when it first came out, but didn’t spend much time with it. I’ll have to revisit it again when I start shooting IR again.

  2. n6mod here. Just tripped over this article, and it’s an interesting approach. John Nack at Adobe tried to point me at the DNG profiler, but it totally misses the point of setting custom WB in camera, namely that you can collect the data you need at the time of the shoot. I seemed to need a radically different DNG profile for each filter, and even then the results weren’t very consistent.

    Correcting in LAB space is interesting, and next time I sit down to do some post-work in IR, I’ll give it a try. Thanks for writing this up!

    • Hey, thanks for commenting. I’m glad you found it useful. I’ve recently come back to shooting IR after a bit of a hiatus, but with a LifePixel converted Canon 300D I’m finding that I need to modify the workflow I described here. I still spend a lot of time in LAB though, and never bother with custom WB. I’ve also never been happy with the channel swapping approach many people use.

      Curiously, I’ve often wondered if there’s a relationship between the blue/yellow Temp settings and magenta/green Tint settings of white balance, and the blue/yellow and magenta/green of the B and A channels respectively. Curious…

  3. It would be really great if you could update this, also with how you do the false colour in lab.
    I have found your method to be one of the best I have tried so far, but I’m still not 100% how to go about getting the WB ‘right’ and then doing the colours…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: