💬Comments welcome. To leave a note, select any text and click the note / highlight button that pops up — or open the panel with the tab at the top-right (‹). Notes are visible only inside our private review group.
jump to

22.13 DNG: the Digital Negative

A raw file is the closest a digital camera comes to a negative: the sensor's own measurements, before the irreversible commitments — demosaicking, white balance, the tone curve, the gamut squeeze into sRGB — that turn data into a finished JPEG. Keep the raw and you keep the right to re-develop the shot later, the way a darkroom printer goes back to the film. The trouble is that, for most of digital photography's history, every camera has written its raw in its own undocumented format — Canon's CR2 and CR3, Nikon's NEF, Sony's ARW, Fujifilm's RAF, and dozens more — each of which software must reverse-engineer, and any of which can quietly become unreadable as the cameras that made them, and the decoders that understood them, age out of support. DNG (Digital Negative) is the response: an open, published raw format, introduced by Adobe in 2004 and built on the TIFF/EP standard, meant to be the single, vendor-neutral, archival container that any tool can read and write. This appendix is a map of what is inside one.

22.13.1 What DNG is, and the problem it solves

DNG is not a different kind of raw — it holds the same sensor measurements a proprietary raw would. What it changes is that the format is documented. Adobe publishes the specification (the current version is 1.7, 2023), so a reader, an archive, or a competing raw processor can decode a DNG decades from now without reverse-engineering a vendor's secret layout. That is the whole pitch: a raw you can still open when the camera that made it is a museum piece. The format is built on TIFF/EP (ISO 12234-2), the imaging variant of TIFF, so structurally it is a close cousin of the EXIF container described in the previous appendix — a table of tagged fields, some pointing at the pixel data, some at metadata, some at the calibration a converter needs.

22.13.2 Inside the container

Open a DNG and you find, in one TIFF/IFD (image file directory) structure: the raw image data itself; the full EXIF record and the camera's MakerNote block; an XMP packet carrying the parametric edit settings, ratings, and keywords (the same non-destructive "recipe" Lightroom and Adobe Camera Raw write — see Recap ISP and non-destructive editing); one or more embedded JPEG previews plus a small thumbnail, so a viewer can show the image without decoding the raw; and the color and calibration data, below, that a converter needs to render the sensor counts into a colorimetric image. In other words a DNG is a superset container — pixels and metadata and the rendering recipe — which is exactly why it can stand in for both the proprietary raw and its sidecar files at once.

22.13.3 What the raw payload looks like: mosaic vs linear

DNG admits two forms of raw data. A mosaic DNG — the usual case — stores the original color-filter-array samples straight off the sensor, one value per photosite in the Bayer pattern, leaving demosaicking for later (→ Demosaicking). A linear DNG stores data that has already been demosaicked, a full red-green-blue triple at every pixel. Linear DNG is what you get after a processing step has run — or for sensors whose layout is not a plain Bayer grid (a quad-Bayer sensor, for instance, is typically remosaiced to a standard Bayer or written as linear DNG; see the quad-Bayer note in Demosaicking). The distinction matters because it says how much of the pipeline has already been committed: a mosaic DNG is the rawer negative; a linear DNG has spent its demosaicking choice.

22.13.4 The color recipe: matrices, profiles, and white balance

Sensor counts are not color — they are three numbers in the camera's own idiosyncratic, non-colorimetric basis, and turning them into real color needs a calibrated map. DNG carries that map. ColorMatrix, ForwardMatrix, and CameraCalibration tags encode the transforms between the camera's raw RGB and the standard XYZ space, supplied for (typically) two reference illuminants — for example CIE Standard Illuminant A (tungsten) and D65 (daylight) — which the raw processor interpolates by correlated color temperature to match the actual scene light. Alongside them, AsShotNeutral (or AsShotWhiteXY) records the camera's own white-balance guess at capture, the neutral point the developer will divide out (the von Kries gains of Color technology — and the temperature-and-tint parameterization of them). For finer control, a DNG camera profile (DCP) adds hue, saturation, and tone adjustments on top of the matrices, which is how two raw converters can render the same DNG with different "looks" while agreeing on the underlying measurement.

22.13.5 Opcodes: corrections the decoder must apply

Some corrections cannot be precomputed into the pixels without throwing away rawness, so DNG defers them as a short list of opcodes — operations the raw processor is instructed to apply at decode time. The common ones are geometric and radiometric lens corrections: WarpRectilinear and WarpFisheye undo geometric distortion (the radial barrel/pincushion remap of Optics, lenses, and aberration correction, here shipped with the file); FixVignetteRadial undoes vignetting; a GainMap applies a per-channel shading correction for lens color cast; TrimBounds crops to the valid area; and defective-pixel maps patch known bad photosites. This is the declarative, file-level face of the lens-profile correction discussed in Optics: rather than hope the editor has a profile for the lens, the DNG can carry the correction instructions itself.

22.13.6 Compression, and embedding the original

The raw payload is normally lossless — DNG defaults to a lossless JPEG compression of the mosaic — or stored uncompressed; there is also an optional lossy DNG that accepts a little fidelity loss for a much smaller file, useful for proofs and archives where the full negative is not needed. One more archival nicety: a DNG can embed the original proprietary raw inside itself, so converting CR3 or NEF to DNG is reversible — the untouched original can be extracted again later, which removes much of the risk of committing to the format.

22.13.7 Where you meet DNG: adoption and relatives

DNG is the native raw format on cameras from Leica and Pentax/Ricoh, and it is the standard raw on most Android phones (the Camera2 API emits DNG); Apple's ProRAW is DNG under the hood, wrapping a computational-photography raw in the open container. The Adobe DNG Converter transcodes proprietary raws to DNG for archiving, and CinemaDNG is the motion-picture variant, a per-frame raw sequence for video. Adoption is not universal, though: Canon, Nikon, and Sony continue to ship their own proprietary raw formats, partly to keep camera-specific features and "secret sauce" that a generic container does not capture — which is the standing tension around DNG.

22.13.8 Trade-offs, and DNG's relation to EXIF

The case for DNG is openness and longevity: a documented, archival format; one pipeline instead of a new decoder per camera; embedded corrections and profiles; and lossless storage that is often smaller than the native raw. The case against is the transcoding step it usually requires, the chance that some maker-note or proprietary raw feature does not survive the conversion, and the reality that not every tool round-trips a DNG perfectly. Finally, because a DNG contains EXIF and XMP, it is best read as a superset of the metadata container from the previous appendix — everything said there about coverage, trust, and privacy applies to the metadata a DNG carries, with the raw pixels and the rendering recipe wrapped around it.