A one-step UniWB procedure

Photoshop, or another image editing program that lets you create images with arbitrary colors.

Rawdigger, or another program that lets you look at the average values of the ref, green, and blue pixels in raw files.

Excel, or another spreadsheet program that can operate with Excel files.

This spreadsheet (Right-click on it and select “Save target as” to download it. Add the suffix “.xlsx” if necessary). Here’s an “.xls” version if your version of Excel is old: OneStepUniWB

Here’s the procedure in brief. There’s a detailed explanation at the end of this page.

In any RGB color space within the gamut of your monitor for which you know the gamma (sRGB is probably the safest choice), make three exposures: one at R=255, G=0, B=0, one at R=0, G=255, B=0, one at R=0, G=0, B=255.

Bring the images into Rawdigger. Enter the average values of the red, green, and blue raw pixels into the appropriate columns in the spreadsheet.

Enter the color space gamma into the spreadsheet.

Enter the desired raw value for the UniWB target.

Read the UniWB target RGB values from the output cells, and fill the test target with that color in Photoshop.

Balance to the test target.

Take a picture of the test target.

Bring that picture into Rawdigger and look at the EXIF WB coefficients and the raw values to see how well you did.

The details follow.

To make the red, green, and blue images in Photoshop, create an image about the shape of your format. Make three layers, on for each color. Then make a fourth layer for the white balance target color. When the colors are all filled in, the layers will look like this:

Click on the foreground color and enter the values for full red as follows:

Use Edit>Fill… to fill the red layer with the foreground color:

Do the same with the green and blue layers. Photograph each of the three layers with an exposure that’s about what your built-in meter recommends for the green layer and bring the files into your computer. Open the spreadsheet.

Here’s what the spreadsheet looks like when you open it:

First, clear all the input cells so you don’t get confused about what you’ve entered and what you haven’t. Don’t worry about the error messages; they’ll go away when you fill in all the input cells:

Bring up the red image in Rawdigger, and look at the average for the R, G, and B channels. Ignore the G2 channel:

Enter the red channel information into the first column of the monitor measurements field in the spreadsheet:

Bring up the green image in Rawdigger, and look at the average for the R, G, and B channels. Ignore the G2 channel:

Enter the green channel information into the first column of the monitor measurements field in the spreadsheet:

Bring up the blue image in Rawdigger, and look at the average for the R, G, and B channels. Ignore the G2 channel:

Enter the blue channel information into the first column of the monitor measurements field in the spreadsheet:

In the entry cell at the Desired camera values column, put a number that is less than the smallest number in the monitor measurements matrix diagonal. It’s not important what this number is, as long as it’s not so small that there’s a lot of camera noise to deal with, or so large that the monitor can’t get bright enough to reach it. I entered 4000:

Enter the gamma of the color space you’re using in the image editing program. In this case, it’s Adobe (1998) RGB, which has a gamma of 2.2 except near 0.

In Photoshop, click on the foreground color square to open up the color picker dialog. Enter the trial monitor values into that dialog.

Fill the white balance layer of your test image with the foreground color:

White balance to the test image, then photograph it and bring the raw file into Rawdigger. Look at the average values for R, G, and B.

Enter those values into the result column of the spreadsheet and read the coefficients. If they’re within 5%, you’re done.

Your monitor values are way too low if you’re going to use 4000, or 2000, or even 1000 as the desired values. You need to get 3 or 4 stops more light on the sensor for 4000. The amount of light isn’t critical. You can get the spreadsheet to calculate trial monitor values that make sense if you enter 100 for desired camera values, but that’s down where there’s a lot of noise.

I’m trying to create the custom WB image for UniWB on a Nikon D750. I believe I followed your procedure as best as I could interpret, however I’m fairly confident I’m not getting the correct coefficients as the review images of subsequent exposures do not have the green cast I’m used to on my Canon 7D when using my UniWB exposure.

I created the three layers for R, G and B respectively in PS in the sRGB color space. With my D750 set to sRGB, flat picture style, and auto WB, I took exposures of all three colors with the ‘middle grey’ exposure value indicated by the camera meter when metering the green layer (this was 1/15 f/5.6 ISO 100 for my monitor’s brightness). Using RawDigger to open each color exposure, I entered the average brightness levels into the 3 x 3 matrix of the excel sheet, set the desired camera input to 500 because the red diagonal value was the lowest of the three values at 559.4. Gamma is set to 2.2. Gamma adjusted monitor values came out to 224, 112 and 148 for R, G and B respectively. Filled a 4th layer with the resulting magenta color and took an exposure of this color with the D750 with auto WB, sRGB color space, flat picture style and at the exposure value given above. I then set custom WB to the image file for this 4th exposure, took a 5th exposure of the magenta layer in PS, opened this 5th exposure in RawDigger and input the resulting average brightnesses into the results column in excel. Coefficients calculated to 0.987543, 1, and 0.966568 for R, G and B respectively. However when I view the EXIF data for the 5th exposure, it shows coefficients of 1.910156, 1.351563, 1, 1 for R, B, G1, and G2 respectively.

Let’s forget the numbers for a while. If you’re white balancing to a strong magenta target, when you aim your camera at a normal scene, the JPEG preview image should look green. Are you sure you’re doing the white balance setting operation in the camera correctly?

Turns out the D750 has another method to set custom white balance. There is a method for “measuring” it without the need to select a reference file on the memory card (this method doesn’t create a file either, I suspect the data is stored in ROM). This method works; I had vastly different coefficients after measuring the magenta layer when inspecting the coefficients of a subsequent snapshot in RawDigger.

I don’t understand why the file reference method was failing. I have some suspicions based on additional testing which I won’t go into here unless interested. My earlier UniWB experiences with Canon bodies was never this difficult.

Thanks for providing this. However, with the a7Rii, I keep getting the error message:
Custom WB Error

I was unclear on just what you meant by:
> “Photograph each of the three layers with an exposure that’s about what your built-in meter recommends for the green layer.”

When I used an exposure that had EC about 0, and the Preview histogram in the middle, the resulting values were quite low. I then used an exposure that just below where “Blinkies” showed up on Review. I still wasn’t able to get values over 3000 for the “Desired Camera Values”.

The spreadsheet did recommend RGB(225,87,196) which is quite Magenta’ish CMYK(3,85,0,0).

But, that resulted in “Custom WB Error” when attempting to “Set”. Drat.

I did use a Photoshop screen with “pure magenta”:
C: 0%
M: 100%
Y: 0%
K: 0%
and was able to get a capture that the “Set” allowed. When I put this in Custom-1 and use Custom-1, the Preview is quite green’ish, and Reviews are quite green’ish. That seems to indicate it may be close.

For now, the simplified Custom WB based on “pure magenta” CMYK(0,100,0,0) seems to be working pretty well.

When I enable Zebra 100+, the preview with zebras works well enough. I’ve been walking around to test with challenging lighting, and increasing exposure so zebras are very visible. Then reduce exposure by 1/3rd clicks until zebras are gone.

When I check in RawDigger, the highest channel tends to be at least 10,000. At worst, I’ll still have two unblown channels, which LR/ACR can deal with to recover.

I make another attempt with your very much appreciated spreadsheet in the near future. It was odd that the a7Rii accepted the “base” of CMYK(0,100,0,0) but put up the error message on RGB(225,87,196).

as Jim noted you need to check WB multipliers in that exif tag… you might live even with not precise UniWB – but for your own sake you need to understand how close you are (just the tint being green or shooting CMYK 0,100, 0, 0 displayed in PS on your LCD is not a guarantee.

As I said earlier, that’s probably close enough. If you’re using the last 10% of the histogram for ETTR, IM you’re pushing it too far and risking clipping. There are other things that you can’t compensate for, like the JPEG subsampling, that could bite you in your nether regions. And, from looking at the WB coefs and RawDigger, you know which channels are low, and by how much, should you decide to push things to the max.