NEF

From OSP Wiki

Jump to: navigation, search

Contents

Introduction

The NEF format (Nikon Electronic Format) is used by several camera models manufactured by Nikon:

  • D1
  • D1H
  • D1X
  • D2H
  • D2Hs
  • D2X
  • D40
  • D40s
  • D50
  • D70
  • D70s
  • D80
  • D100
  • D200
  • Coolpix 5400
  • Coolpix 5700
  • Coolpix 8700
  • Coolpix 8800

A variant of the NEF format is the NDF (Nikon Dust reference Format) that contains a "dust reference" instead of a picture. A dust reference is a picture taken in a special way, against an homogeneous subject, in order to locate dust on the sensor. The dust reference is used by Nikon Capture Editor to automatically remove dust noise.

Header

The header for the NEF format complies with the standard TIFF header.

TODO: NDF files are different: they have 12 extra leading bytes start with the "NDF" string.

Raster formats

Makernote

There are three different types of maker note for the NEF format:

  • type 1
  • type 2
  • type 3: used by all DSLR cameras

Type 3

code name type enumeration description
1Firmware Versionundefined[4] The firmware version of the camera.
2ISOshort[2] The ISO settings used to take the photo. The first number can be 0 or 1 and could be related to the Auto ISO setting.
3Color Mode (?)asciiCOLORThe value is always COLOR. To check on D200, which has a b/w mode and probably uses a new value.
4QualityasciiRAW, RAW2.7MThe quality setting used to take the photo.
5White BalanceasciiAUTO, CLOUDY, FLASH, INCANDESCENT, PRESET, PRESET1, SUNNY, WHITE PRESETThe white balance setting used to take the photo. The string is right padded with spaces.
6SharpeningasciiAUTO, HIGH, LOW, MED.H, MED.L, NONE, NORMAL, emptyThe sharpening setting used to take the photo. The string is right padded with spaces.
7Focus ModeasciiAF-A, AF-C, AF-S, MANUALThe focus mode used to take the photo. Note that the value is right padded with blanks.
8Flash SettingasciiNORMAL, REAR, REAR SLOW, RED-EYES, LOW, empty
9Auto Flash ModeasciiComdr., MNEW_TTLOptional, TTL, empty
11White Balance Finesigned short[1] Fine adjustment of white balance as set in the camera. The range is [-3..+3].
12White Balance RB Coefficientsrational[4] The first two numbers are coefficients to multiply red and blue channels according to white balance as set in the camera. The last two numbers can be 0/1, 1/1 or 256/256.
13tag13undefined[4]
14Exposure Difference (?)undefined[4]
15ISO SelectionasciiAUTO, MANUAL
16Data Dumpundefined[]
17Thumbnail Offsetlong[1] ????
18Flash Compensationundefined[] ????
19ISO Requestedshort[2] ????
22NDF Image Boundaryshort[4]
24Flash Bracket Compensation (?)short[1]
25AE Bracket Compensation (?)short[1]
27Sensor Sizeshort[2] The horizontal and vertical photosite count on the sensor.
29D2X Serial Numberascii -

obfuscating some relevant information about white balance.

128Image AdjustmentasciiAUTO, NORMAL????
129Tone CompensationasciiAUTO, CS, HIGH, LOW, NORMALThe tone compensation as set in the camera.
130Lens Adapter (?)asciiOFF????
131Lens Typebyte[1] A bitwise mask which describes the type of lens. If not bit is set the lens is a AF non-D lens.
132Lens Rangerational[4] Two pairs focal/max f-stop that describe the lens.
133Focus Distancerational[1] ????
134Digital Zoomrational[1] The digital zoom used for taking this shot (it's always 1 for DSLR models).
135Flash Typebyte[1]0, 3, 4, 7, 8, 9The type of flash unit used.
136AF Focus Positionundefined[] Which sensor was used to lock the focus.
137Bracketingshort[1] ????
139Lens F Stop (?)undefined[] ????
140Curveundefined[] A lookup table (LUT) to be used for applying the contrast (see also Tone Compensation)
141Color ModeasciiMODE1, MODE1a, MODE2, MODE3, MODE3aThe color mode bas set in the camera. Note that the value is right padded with blanks
142Lighting Type (?)ascii ????
143Scene Mode (?)ascii ????
144Light TypeasciiCOLORED, MIXED, NATURAL, NORMAL, SPEEDLIGHT????. Note that the value is right padded with spaces; sometimes is zero-terminated.
146Huesigned short[1] The Hue setting.
147Flash Unknown Info (?)short[1] ????
148Saturationsigned short[1] The Saturation setting.
149Noise ReductionasciiFP, NR, OFF
150Compression Dataundefined[] This data block contains the initial value for the predictors and a lookup table used with the Nikon compression scheme (see the Raster Format section).
151Block 151undefined[] The Block 151 contains some information about White Balance for D2X.
152Lens Infoundefined[] ????
153Bayer Unit Countshort[2] The number of Bayer Units (horizontal count, vertical count).
154Sensor Pixel Sizerational[2]
160Camera Serial Numberascii An unique ID of the camera.
162NDF Lengthlong[1] The length of the raster data if this is a NDF image (dust reference).
167Shutter Countlong[1] A progressive number that is incremented at each shutter operation.
169Image Optimization (?)asciiCUSTOM, NORMAL, empty????
170Saturation 2 (?)asciiENHANCED, MODERATE, NORMAL????
171Vari ProgramasciiAUTO, CLOSE UP, LAND SCAPE, NIGHT PORTRAIT, NIGHT SCENE, PORTRAIT, SPORT, emptyFor camera models that support it, this tag contains information about the automatic program that was used.
3584Print IM (?)undefined[] ????
3585Capture Editor Dataundefined[] When a NEF image is processed by using Nikon Capture Editor and changes are saved, this tag contains a block of bytes which contains the NCE settings.
3598Capture Offsets (?)long[1] ????
3600tag3600long[1] ????
Personal tools