D7100 UniWB files

Started May 13, 2013 | Discussions thread
Flat view
PepsiCan Contributing Member • Posts: 739
D7100 UniWB files

Hi everyone

First of all, the below could only have been written thanks to

Iliah Borg, Marianne Oelund, Gollywob, Malch, and many others...

Although with today's sensors and software we can do amazing recoveries of shadows and highlights, we still obtain the best results when the exposure is set right in the camera. The challenge here is twofault:

1) the camera metering doesn't always get it right.

2) the histograms we review and the highlight clipping we view are based on (the embedded) JPEG, not RAW.

Therefore, we don't really know whether there is leeway to optimise exposure further or whether highlights have been clipped. For that, you'd need a histogram of the RAW file. That is at this stage technically not possible. However, we could aim for a histogram of a JPEG that is as close to the RAW file as possible. That histogram would tell us whether we're clipping highlights and/or are losing detail in the shadows. You can also use it as a tool to decide to use HDR as a solution to capture the scene when you have both loss of highlights and shadows.

The question then is how you create such a JPEG. And this is how you do it. You need to do three things:

1) A RAW file consists of pure Red, Green and Blue (RGB). There is no channel amplification of one colour over any of the other colours. So, you need to eliminate the effects of white balancing by creating a white balance that amplifies the R, G and B channel by 1 only. Hence the name Unitary White Balance (UniWB). If you use a tool like RAWDigger, or DCRAW, you can see that under normal circumstances, for a Nikon camera, the Blue and Red channels are multiplied by more than 1. How much depends on the white balance used (Auto, Flash, Custom etc).

2) Turn the picture controls off. Now, you can't do that. But you can ensure they are all set to neutral. No sharpening, no contrast and choose the widest colour space your camera can handle (Adobe RGB)

3) A RAW file has a linear gamma. But a JPEG and the colour space in it, do not. So, you need to apply an inverse curve during the RAW-to-JPEG converse process to ensure the JPEG ends up with a linear curve.

Items 2) and 3) you can combine using Nikon Picture Control Utility (part of ViewNX since jonk years).

For 1) you need to create a file with a white balance that will multiply the R, G and B channels by 1 each only. Or rather, you need to create a file where the channel multipliers are as close to 1 as possible without going below 1. That way, the righthand side of the histogram is truly the edge of what the RAW file can handle. In other words, you need to create the colour that the camera would see as perfect neutral grey. This is how you create the file:

a Open MS Paint (or the Apple equivalent) and create a new file.

b Create a colour of R = 128, G = 64, B =128. The reason G is lower has to do with the way sensors work and green pixels occur twice as often as the R and G pixels on the sensors.

c Fill the screen with this colour

d Set your camera to RAW (optional), and release priority

e Time to create a new White Balance Pre-set (check your manual if you do not have a D7100). Also, turn off lights that may reflect on the monitor screen.

f In the case of the D7100, set WB to PRE and one of the 6 slots and then press the WB button until the word PRE starts flashing in the viewfinder. Then take a out-of-focus picture of the screen (to avoid any rasters) and ensure the the frame is fully filled with the one colour. When the WB can be determined by the camera, it will flicker GD in the viewfinder. You have now created a new white balance!

g Take a second picture using the white balance you just created. What you take the picture of, doesn't matter. This will create a NEF or JPEG with the new White Balance in it.

h Remove the memory card from the camera and copy the picture to your PC.

i Use DCRAW or RAWDigger (or your own favourite EXIF reader) to determine the channel amplification. For DCRAW, use DCRAW -i -v -w <path+filename>. If you get something like 1.015324 1 1 0, then you are done. You now have a multiplier for Red of 1.015 (you are 1.5% away from the ideal value), a perfect multiplier of 1 for Green and a perfect multiplier of 1 for Blue. However, it is unlikely that you'll get it right the first time. More likely, you'll see something like 1.34567 1 1.2788 0. So, you need to increase the values of R and B in MS Paint so the multiplier for R and B can drop.

j So, if you are within 5% of the value 1, you can skip to l. Otherwise you need to go to k.

k Change the color in MS Paint and increase the R and B channels. Leave G be. You need to increase and decrease to get as close as possible to 1 on R and B (G is always 1). Then return to step e and repeat until you're happy with the result.

l You now have a UniWB saved in your White Balance preset. For safety, you can install the picture you took with that white balance on your memory card so you always have it. You can also look the Preset so you cannot accidentally whipe the white balance.

We're almost there.

In Nikon Picture Control Utility, do the following: 1) tick Manual Adjust 2) tick Custom Curve 3) Change the curve by pulling it downwards until you get to Input: 128 and Output: 56. 4) Save it under an appropriate name 5) Export this Picture Control onto your memory card 6) In the camera go to "Manage Picture Controls" and import the custom control.

So, there you have it done! All done.

Of course, there is an easier way. If you have a D7100, download the attached files. It is a JPEG with the white balance and NTC file for Nikon Picture Control Utility (import by doing step 1) and 2)).

For more information, try these websites. http://www.malch.com/nikon/UniWB.html http://www.guillermoluijk.com/tutorial/uniwb/index_en.htm search DP Review for UniWB

Take care!

The very UniWB file.

 PepsiCan's gear list:PepsiCan's gear list
Canon PowerShot S95 Adobe Photoshop Lightroom 4 Nikon D7100 Nikon AF-S DX Nikkor 16-85mm f/3.5-5.6G ED VR Nikon AF-S DX Nikkor 35mm F1.8G +5 more
Flat view
Post (hide subjects) Posted by
MOD Mako2011
MOD Mako2011
MOD Mako2011
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow