What you’ll need:
- The setup described in the preceding page.
- 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.
You can check the EXIF data to make sure.
Next: The math behind the one-step method
Nick Wheeler says
“Enter the desired raw value for the UniWB target”
Jim, it’s not clear to me what this means? Is this the “White Balance” number in the camera or a raw processor?
So one is going to enter a number of 5500 for a “daylight balanced” histogram? Then leave the camera set at Daylight.
I’m not getting the big picture here.
Jim says
Nick, it’s the desired raw value. 4000 is a good number; that’s two stops down from full scale for your D800. 2000 or 1000 also work. I wouldn’t go below 1000.
Jim
Dag von Arnold says
Hi Jim,
Can’t get reasonable values (all under 255) in the first column.
My monitor measurements are:
R G B
117.8000 92.6000 11.6000
29.7000 350.1000 71.8000
4.3400
I have tried with different ‘Desired Camera Values’ of 4000, 2000, and 1000.
Jim says
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’ve added an explanatory sentence about exposure.
Can you open up three or four stops?
Jim
Dag von Arnold says
continuation – last row RGB values
4.3400 86.3000 147.2000
When I enter Desired camera Values of 1000 and Gamma 2.2
I get the firs column values
621
258
575
I have tried Desired Camera Values of 2000 and 4000 as well.
If I input the values from your document I get the same results as you. So I guess my RGB values are wrong.
I run latest versions of RawDigger and Open Office. PS CS4 and the RGB is shot with an Ricoh GXR 16 mp.
Do you have any tips?
T.C. says
Jim,
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.
Where have I gone wrong?
Jim says
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?
Jim
T.C. says
Yes. I take the photo of the wine chart, then set my WB to that photo. Subsequent photos do not come out green.
Jim says
That’s hard for me to understand.
T.C. says
Good news Jim.
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.
Jim says
That is good news.
Lynn Allan says
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.
Any idea what I am doing wrong?
Jim says
No. When you look at your WB coefficients in the EXIF data after balancing to the magenta screen, what are they? Look for the tag: WB RGGB Levels.
n/a says
> Custom WB Error
just ignore this message – WB will be set still
Lynn Allan says
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).
Jim says
WB coefficients in the EXIF data?
n/a says
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.
Lynn Allan says
Seems to be working ok. I was able to get the “Results Coefficients” within 4% (barely).
The EXIF was:
WB RGGB Levels: 940 1024 1024 996
That seem ok?
And thanks for your patient assistance.
Jim says
I think that’s good enough. You should probably do some test shots and look at the files in RawDigger.
Jim
Lynn Allan says
Here’s some results:
http://www.dpreview.com/forums/post/56444097
I suppose ideally the WB RGGB values should have been closer to each other. They were within 4% of the middle value, but the difference between the lowest and highest was more like 8%. My bad.
Jim says
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.
Jim
John says
Excellent article, I was using uniWB with my Nikon d800e. Since upgrading to the D850 I no longer have access to the uniWB setting, although this article shows how to set uniWB up I wondered…
Does anyone have a uniWB file to download for the Nikon D850?
Many thanks in advance should someone supply a download link to help poor old soul out 🙂
SE says
Does this method work for the D850? I have been using UWB since 2005 and have constructed UWB references for multiple Nikon DSLR models. I have even used your technique for my older D700, D800 and D810 in the past with no problem. I cannot seem to get the D850 to produce a UWB using the same method (yours) as I have previously used.
It’s been 4 years since I did the D810 so I wanted to clarify this step.
“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.”
I have my “pink” test target configured on the monitor. I take a shot of this using my original white balance (image is pink). I then select this shot to use as a reference WB image in the camera and then take another shot of the test target using that reference WB. Shouldn’t the UWB shot of the “pink” target now appear grey as it did with all the other models? It doesn’t, it still appears pink and the WB multipliers have not changed.
SE says
Agh….figured it out…..should be doing this at midnight. Don’t bother posting earlier problem.
spider-mario says
I can’t seem to get sensible results with an Olympus Tough TG-6 (yes, maybe a strange camera to use UniWB with…), but then my initial R, G, B measurements are somewhat weird to begin with.
sRGB R on the monitor: RAW average of 2694, 966, 199.
sRGB G on the monitor: RAW average of 247, 1064, 239.
sRGB B on the monitor: RAW average of 121, 747, 2531.
I don’t really understand why the green levels are so much lower than the red and blue channels.
When I enter those values and a desired camera value of 1000 into the spreadsheet, it suggests 81, 107, 84 in linear space, or 151, 172, 154 in gamma-corrected space. (So, more green than magenta.) Creating an image with this color, using it for white balance, and taking a shot of it, the average RAW levels are then: 1301, 2426, 1285.7. The white balance coefficients, according to darktable, are 1.867, 1, 1.906. (478 488 256 256 in the EXIF data.)
I feel like I must be missing something obvious, but I am not sure what. The ratio between the raw values is suspiciously close to (1, 2, 1), instead of the (1, 1, 1) that we are trying to achieve. Could it be that the camera divides the raw green values by two compared to the other two channels?
(I tried my best to take all the shots at the same exposure (f/4.9, 1/2s), but apparently I accidentally took the red one at 1/2.5s instead. Still, I don’t think it changes much to my question.)
spider-mario says
> Could it be that the camera divides the raw green values by two compared to the other two channels?
I tried blowing out all four channels, and they all clip at the same level (3838), so apparently that’s not it. (?)
spider-mario says
Ah, but applying K_ADC ≃ S(DN) / σ², I do find different K_ADC values for the various images.
For the red channel in the red image, I get ~0.12 e-/DN.
For the green channel in the green image, ~0.24 e-/DN.
For the blue channel in the blue image, ~0.15 e-/DN.
Do those values seem plausible at all or did I mess that up too?
JimK says
You’re saying that, after the CFAs, the green channel has about half the sensitivity (in counts) of the other channels? I’ve never heard of a thing like that. Green usually clips first, so maybe they’ve done that to even things up. If so, uniWB will be achieved with something other than the green cast it gets on most cameras. I don’t know where in the pipeline the green channel sensitivity is reduced. The camera doesn’t seem to fit the standard model. Based on all this, do you really want to uniWB this camera?
spider-mario says
That’s a fair point, maybe it’s indeed not worth risking it.
JimK says
It’s a mystery to me. I’ve never heard of that camera.
spider-mario says
That’s understandable, as it’s a rather niche product: it’s a waterproof/dropproof/crushproof compact with a 1/2.3″ sensor and a 4.5-18mm f/2-4.9 lens, and no fully manual mode (I had to use the exposure compensation dial to try to get the same exposure for all shots). So, there may not be that much overlap with the kind of people who would typically use UniWB and ETTR. 😀
Thanks anyway, your spreadsheet will be very useful in any case, at first most likely for my other cameras (maybe I should have started there), but then maybe also for this one once I get to the bottom of this.
spider-mario says
Aargh, I finally figured it out. It was so silly, I feel like a complete idiot.
Basically, I had generated my red/green/blue images like so:
$ parallel convert ‘xc:{}’ -geometry 2000×2000 ‘{}’ ::: red green blue
But while ImageMagick’s “xc:red” is (255, 0, 0), and “xc:blue” is likewise (0, 0, 255), “xc:green” is actually (0, 128, 0), and (0, 255, 0) is called “green1” instead. I have no idea 1. why this is the case and 2. how I did not notice.
For the K_ADC estimations (which were suspiciously small), I must have sampled too large of an area, such that light fall-off contributed disproportionately to the variance.
When fixing those two issues, I get much more sensible results in both areas. Sorry for bothering you with this, and thank you for the help! I was thus able to UniWB this camera after all, which should help get the best out of its 6.2×4.6mm sensor.
John says
Ok so I finally got my act together and had a go at this…
My set up:
D850
Milvus 85 f/1.4 @ f/8 (now realise f/5.6 would have been better for noise?)
Eizo cg222 monitor (98% of Adobergb gamut)
Tripod
Pitch black bedroom (lol)
I did eaxactly as above and got these results in the spread sheet:
Trial Monitor Values Gama Adjusted:
242
151
194
Desired camera values:
1000
1000
1000
Monitor measurements:
R G B
1015.0 226.4000 41.8000
184.8000 2002.7000 367.3000
65.4000 586.9000 1376.8
Gamma:
2.2
Result:
1018.35
999.6
1009
Coefficients
0.98159
0.99068
Can someone just run by this and confirm if everything looks ok please?
JimK says
Looks OK to me…
John says
Hi Jim, thanks for that. Looks like I’m seeing approx 1/3 more headroom on the histogram.
I think the blinkies on the d850 are not that far off to be honest.
Still very useful to see the rgb histograms with the uniWB.
Am I right in thinking you don’t want the green histogram touching the right side even though it’s pronounced due to the green uniWB preset?
Xuan Zheng says
Hi Jim,
I am currently trying to scan a bunch of slides I owned (Kodachrome, fujifilm, etc) with a RALENO light table, I wonder if I can simply set the camera WB to RALENO light table at full brightness, OR
UniWB setup is necessary? These slides are notoriously difficult to capture its full Dynamic ranges, thus I want the zebras to represent the clipping point as accurate as possible…
The UniWB steps are bit tedious for me (taking a magenta-ish tablet picture and adjust until Blue Red multipliers are all 1s)… I admit I am a lazy ass but needs your opinions…
Sincerely
JimK says
It’s not perfect, but what I would do were I in your shoes is set up your gear, find a slide with a clear film base density highlight, guess the exposure, take a bunch of pictures at tenth stop intervals on both sides of that, bring them all into RawDigger and find the ETTR one, then shoot all the slides on that film at that exposure.
Xuan Zheng says
Thanks for your reply, unfortunately the slides are of different level of exposures, thus one size fits all might not work…. I guess UniWB is something necessary I need to setup…
I use ExifTool to read out the “Red Balance” and “Blue Balance” multiplier, do you think ExifTool would suffice and has the accuracy for the R&B multiplier?
btw, is light table set to 5000K good enough for this job? The RALENO has a range from 3600k t0 5500k.
Thanks for your prompt reply
JimK says
With respect to Exiftool and the WB numbers, that won’t help much. 5000 Kelvin is fine. Try the method I suggested with RawDigger. Scan your slides. Then look at the scans with RawDigger and see how far they are from ETTR. If they’re less than two thirds of a stop off, don’t worry about it. If more rescan with an excressed exposure calculated from the RawDigger histograms.
Or bite the bullet and use UniWB.
Xuan Zheng says
I see, it seems that the sole Red/Blue multiplier numbers ExifTool provided has a presumed Gamma value, thus rendered them less accurate for UniWB?
The camera setup already mounted on the film scanning gizmo and took them off for UniWB calibration will jinx my painstakingly set up film scanning evenness…… I will probably slightly modify your method to match ETTR, since slides don’t change at all, I simply took 3 different EV brackets around “neutral” 109+ with RALENO light table WB(Sony A7r IVA with sigma 105mm MACRO) zebra and hope at least one photo can achieve the desired full bits exposure… SD card space is plenty and bracketing isn’t an issue for me. 🙂
JimK says
That should work, too. You can use RawDigger to pick the right exposures.