2

When shooting RAW images in AUTO WhiteBalance mode, the camera will somehow determine what it thinks is a good WB for the picture. In Photoshop (CS6), there is no way I can find to extract the ColorTemp; the EXIF:ColorTemperature reads "0" and the WhiteBalance="AUTO".

When you bring the NEF (for Nikon) into Adobe Camera Raw (ACR), it will show the ColorTemp (like "5550") and the "TINT" (like -4) the camera estimated when the image was shot.

ACR almost certainly conjurers the ColorTemp and the Tint from the EXIF:WB_GRBGLevels (like "256 496 371 256") constants which characterize the picture’s colors. The only way I can get to these is to:

  1. right click on a NEF
  2. Select Open in Photoshop (which launches Adobe Camera Raw)
  3. In ACR, click on the right side icon on the BASIC menu
  4. Click on Export settings to XMP

Results from exported XMP: D:\pic\new\cd-2014.1225-nef>egrep "Temp|:Tint" _BPB0920.xmp crs:Temperature="4950" crs:Tint="+4"

The EXIF data contains no 4 digit numbers which could be the ColorTemp:

exiftool.exe -* _BPB0920.NEF | gr "\b\d{4}\b" | egrep -vi "date|version|file|time|copy|binary" Image Width : 7424 Image Height : 4924 ISO Setting : 1000 Raw Image Center : 3712 2462

The ColorTemp is one of the most critical pieces of data for any picture and it appears to be totally hidden from the user without a 4 step, manual Kabuki Dance.

Is there some simple method I am overlooking? There must be some way to calculate the ColorTemp/WhiteBalance in Kelvins based on the EXIF WB tags.

Have any of the Photo-Mathematicians here figured this one out yet?

BPB

TAGS: WhiteBalance ColorTemperature Tint Photoshop ACR EXIF WB_GRBGLevels RGB translate

==========================================================
Results of an Exiftool extraction of just Nikon Maker Notes suggested by Joanne C
sub nef_makernote() { $file = $ARGV[0]; $et = new Image::ExifTool; %ET_OPT = (Group0 => ['MakerNotes']); %ii = %{$et->ImageInfo($file, \%ET_OPT)}; printf("File $file, size %4.3f MB has %d MakerNote keys\n", (-s $file)/1E6, scalar keys %ii); $ii = -1; while(($key, $val) = each %ii) { $ii++; print("$ii) $key -> $val\n"); } }

There are quite a few Maker Notes; Here is the limited attention span summary:
bb.pl il-2014.0529-226127.nef | grep W 39) WB_GRBGLevels -> 256 485 380 256 42) WhiteBalance -> Auto1 56) WB_RBLevels -> 1.89453125 1.484375 1 1 90) WhiteBalanceFineTune -> 0 0 103) Quality -> RAW

And the gory details:
`Running c:/bin/bb.pl il-2014.0529-226127.nef Sun Dec 28 11:41:26 2014 File il-2014.0529-226127.nef, size 38.579 MB has 137 MakerNote keys 0) MinFocalLength -> 28.3 mm

  1. ExposureBracketValue -> 0
  2. NEFLinearizationTable -> SCALAR(0x2683e60)
  3. VibrationReduction -> On
  4. PhaseDetectAF -> On (51-point)
  5. ISOExpansion2 -> Off
  6. FlashExposureBracketValue -> 0.0
  7. PictureControlVersion -> 0100
  8. ToningSaturation -> n/a
  9. FlashGroupAControlMode -> Off
  10. FlashGroupACompensation -> 0
  11. MultiExposureShots -> 0
  12. FlashGroupCControlMode -> Off
  13. AFFineTuneAdj -> 0
  14. AFFineTune -> Off
  15. PowerUpTime -> 2014:05:29 08:34:27
  16. FirmwareVersion -> 1.02a
  17. FlashExposureComp3 -> 0
  18. ShutterCount -> 226127
  19. MaxFocalLength -> 302.0 mm
  20. ContrastDetectAF -> Off
  21. CommanderInternalManualOutput -> Full
  22. Timezone -> -06:00
  23. WB_RBLevels -> 1.89453125 1.484375 1 1
  24. Contrast (1) -> Normal
  25. YResolution (4) -> 300
  26. Sharpness (1) -> 5
  27. AutoBracketOrder -> 0,-,+
  28. ExternalFlashCompensation -> 0
  29. Compression (4) -> JPEG (old-style)
  30. SerialNumber -> 3000001 ;)
  31. HighISONoiseReduction -> Normal
  32. ExternalFlashFlags -> (none)
  33. NEFCompression -> Lossy (type 2)
  34. FlashGroupCCompensation -> 0
  35. ResolutionUnit (4) -> inches
  36. PictureControlName -> Standard
  37. LensDataVersion -> 0204
  38. ExposureTuning -> 0
  39. RepeatingFlashOutputExternal -> 1
  40. FlashGroupBCompensation -> 0
  41. ContrastDetectAFInFocus -> No
  42. CommanderInternalFlash -> TTL
  43. Lens -> 28-300mm f/3.5-5.60000000000001
  44. FlashCommanderMode -> Off
  45. FlashInfoVersion -> 0105
  46. ISOSetting -> 125
  47. FocalLength (1) -> 28.3 mm
  48. ISOExpansion -> Off
  49. LensIDNumber -> 165
  50. CommanderGroupAManualOutput -> Full
  51. ProgramShift -> 0
  52. PreviewImageLength -> 104006
  53. DaylightSavings -> Yes
  54. DirectoryNumber -> 237
  55. ColorSpace -> Adobe RGB
  56. FlashSetting ->
  57. CommanderGroupB_TTL-AAComp -> 0
  58. ToningEffect -> n/a
  59. ShootingMode -> Continuous, Exposure Bracketing
  60. LensType -> G VR
  61. AutoBracketingMode -> Flash/Speed
  62. NoiseReduction -> Off
  63. SequenceNumber -> 0
  64. ExternalFlashExposureComp -> 0
  65. FlashColorFilter -> None
  66. MultiExposureMode -> Off
  67. WhiteBalanceFineTune -> 0 0
  68. FlashMode -> Did Not Fire
  69. ModelingFlash -> On
  70. AFAperture -> 3.6
  71. PreviewImageStart -> 923124
  72. MaxApertureAtMinFocal -> 3.6
  73. YCbCrPositioning (2) -> Co-sited
  74. AFFineTuneIndex -> n/a
  75. FlashExposureComp4 -> 0
  76. VRInfoVersion -> 0100
  77. CropHiSpeed -> Off (7424x4924 cropped to 7424x4924 at pixel 0,0)
  78. ISO (2) -> 126
  79. MultiExposureAutoGain -> Off
  80. ActiveD-Lighting -> Auto
  81. FlashCompensation -> 0
  82. ShotInfoVersion -> 0222
  83. CommanderChannel -> 1
  84. VRMode -> Normal
  85. VignetteControl -> Normal
  86. HueAdjustment -> None
  87. ExternalFlashFirmware -> n/a
  88. WhiteBalance -> Auto1
  89. FocusMode -> AF-C
  90. WB_GRBGLevels -> 256 485 380 256
  91. MCUVersion -> 167
  92. ContrastCurve -> SCALAR(0x696bf18)
  93. FilterEffect -> n/a
  94. FlashShutterSpeed -> 1/8 s
  95. AFPointsUsed -> A6
  96. MakerNoteVersion -> 2.10
  97. CommanderGroupBMode -> TTL
  98. FileInfoVersion -> 0100
  99. AFInfo2Version -> 0100
  100. FlashControlBuilt-in -> Commander Mode
  101. DateDisplayFormat -> M/D/Y
  102. FlashGroupBControlMode -> Off
  103. PrimaryAFPoint -> A6
  104. LensFStops -> 5.33
  105. FileNumber -> 6458
  106. FlashExposureComp2 -> +2/3
  107. ISO2 -> 126
  108. ExitPupilPosition -> 85.3 mm
  109. Saturation (1) -> Normal
  110. PictureControlAdjust -> Full Control
  111. CommanderGroupBManualOutput -> Full
  112. AutoBracketingSet -> AE & Flash
  113. RawImageCenter -> 3712 2462
  114. RetouchHistory -> None
  115. CommanderGroupA_TTL-AAComp -> +0.3
  116. CommanderInternalTTLComp -> -2.7
  117. FocusPosition -> 0x66
  118. PictureControlQuickAdjust -> Normal
  119. EffectiveMaxAperture -> 3.6
  120. FlashControlMode -> Off
  121. PictureControlBase -> Standard
  122. MultiExposureVersion -> 0100
  123. XResolution (4) -> 300
  124. ExposureDifference -> 0
  125. AFAreaMode -> Dynamic Area (9 points)
  126. CommanderGroupAMode -> TTL
  127. Brightness -> Normal
  128. Quality -> RAW
  129. FlashExposureComp -> +1
  130. FlashSource -> None
  131. MaxApertureAtMaxFocal -> 5.7
  132. FlashGNDistance -> 0
  133. FlashType ->
  134. AutoDistortionControl -> Off
  135. FlashSyncSpeed -> 1/250 s
  136. FocusDistance -> 6.68 m Elapsed time = 0.087 seconds.`

Looking for 4 digit numbers lurking behind weird labels:
bb.pl il-2014.0529-226127.nef | gr "\b\d{4}\b" | egrep -iv "version|time|2014" 14) FileNumber -> 6458 21) RawImageCenter -> 3712 2462

I do not see any evidence of a numerical ColorTemp/WhiteBalance or a Kelvin reading.
Where's Kelvin?! :(

================================================================ Here is yet another attempt to coax a usable color temp/tint out of a NEF file shot with WhiteBalance=AUTO suggested by MirekE using the ASShotNeutral EXIF value.

Nikon does not record this info, but it is present in DNG files. Downloaded the latest adobe DuNG converter (does just what the name implies :). Converted D800E .NEF -> .DNG
Results:

EGAD!!! Yet another incomprehensible, incompatible White Balance surrogate to throw upon the existing Mountain of Babelian blather! There now exists the ASShotNeutral EXIF tag in new and nebulous proprietary format:
>exiftool.exe -ASShot* -WB -whitebala -S -ver pf-2012.0620-3947.dng
9.77
AsShotNeutral: 0.504931 1 0.699454 < New and Improved OBFUSCATION?
WB_RBLevels: 1.98046875 1.4296875 1 1
WB_GRBGLevels: 256 507 366 256
WhiteBalance: Auto1
WhiteBalanceFineTune: 0 0

Adobe Camera Raw (ACR) somehow munges some of this "information" and displays "As Shot"=4950 and "Tint"=+15. How remains a mystery!

Here is the scorecard so far:
Nikon: WB_RBLevels = 1.98046875 1.4296875 1 1
DCRaw: multipliers = 1.880420 1.000000 1.532661 1.000829
adobe_DuNG: ASShotNeutral = 0.504931 1 0.699454
ACR: Temp=4950 & Tint=+15

These are all different formulations of "WhiteBalance" for the same NEF; the Rosetta Stone of WhiteBalance. How does one programmatically translate any of these to another?

And, we are no closer to a simple formula translating the NEF EXIF WB* "multipliers" into useful Temp/tint which can be plugged into an XMP file for ACR to use to transmute a raw. My Kingdom for a Decrypter Ring or a Babel Fish!

3
  • Have you looked at the MakerNotes section? A lot of camera specific info is stored there rather than in the main EXIF.
    – Joanne C
    Dec 27 '14 at 15:24
  • The Nikon-specific WB tag is WhiteBalance and it is valued at "AUTO1". One other available is WhiteBalanceFineTune = 0 0.
    – BrianP007
    Dec 27 '14 at 22:30
  • I don't think it is that obvious. I think there are several information sources that get combined to determine this. Look for 'WB' prefixed entries.
    – Joanne C
    Dec 28 '14 at 3:09
2

The problem with color temperature expressed in Kelvins is that they do not refer to a single color bias - the same temperature can be expressed with different color values. So for raw files, it is more useful to keep this information as series of two or three color values as opposed to K. You could use

exiftool -AsShotNeutral <raw file name>

with some cameras, but it won't work with all. These numbers can be recalculated to K, so raw editors can show the K value.

That said, I suspect that in case of AWB the K value may not be recorded in the file at all.

Update based on edit of the original question:

And, we are no closer to a simple formula translating the NEF EXIF WB* "multipliers" into useful Temp/tint which can be plugged into an XMP file for ACR to use to transmute a raw.

I don't know how to decipher the NEF data, but from your update it looks like DNG converter can at least convert that to AsShotNeutral. And as far as AsShotNeutral is concerned, it can be converted to temperature and tint, but in order to do that, you would need additional profile data to do that. If I recall correctly, the DNG SDK sample code might have some example how to do that.

1
  • EGAD!!! Yet another incomprehensible, incompatible White Balance surrogate to throw upon the existing Mountain of Babelian blather!
    – BrianP007
    Dec 30 '14 at 17:05
0

Since you are using a Nikon, simply open the photo in the free Nikon software ViewNX 2 and in the white balance box there is a slider called "Fine Adjustment" and to the right of that slider is a white box with the value of the color temperature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.