A DNG file is a raw image in Adobe's Digital Negative format: TIFF 6.0 extended with tags that describe sensor data, color calibration and previews. Its metadata lives inside the file, in the same EXIF, IPTC and XMP structures a TIFF uses. That is the practical difference from proprietary raw formats like CR2 or NEF, where editors usually write changes to a separate XMP sidecar.
What the DNG specification adds to TIFF
The current specification is version 1.7.1.0, dated September 2023. It stays compatible with TIFF-EP, and its additions that matter for metadata are few:
| Tag | Name | Role |
|---|---|---|
| 0xC612 | DNGVersion | Required in IFD0, four bytes such as 1.4.0.0 |
| 0xC613 | DNGBackwardVersion | Oldest reader version able to open the file |
| 0xC614 | UniqueCameraModel | Camera name used to match color profiles |
| 0xC634 | DNGPrivateData | Private data from the camera maker or converter |
| 0xC68B | OriginalRawFileName | Name of the raw file a converter started from |
| 0xC68C | OriginalRawFileData | That entire raw file, embedded |
Previews follow TIFF conventions. NewSubFileType is 0 for the main image and 1 for a preview, and the spec recommends a thumbnail in the first IFD with the raw data in a SubIFD tree. EXIF goes in a normal ExifIFD (preferred over the TIFF-EP locations), IPTC in tag 33723 (0x83BB) and XMP in tag 700 (0x02BC). Raw data is often stored with Compression 7, lossless JPEG; DNG 1.7 added JPEG XL as an option.
An iPhone ProRAW file, IFD by IFD
Apple ProRAW, available on iPhone 12 Pro and later Pro models from iOS 14.3, is DNG. Apple quotes about 25 MB for a 12 MP ProRAW photo; this iPhone 12 Pro sample is 29 MB:
$ exiftool -a -G1 -s -DNGVersion -UniqueCameraModel -SubfileType -Compression IMG_1361.DNG
[IFD0] DNGVersion : 1.4.0.0
[IFD0] UniqueCameraModel : iPhone13,3 back camera
[IFD0] SubfileType : Reduced-resolution image
[SubIFD] SubfileType : Full-resolution image
[SubIFD1] SubfileType : Semantic Mask
[IFD0] Compression : JPEG
[SubIFD] Compression : JPEG
[SubIFD1] Compression : Lossy JPEGIFD0 is a full-size 4032x3024 JPEG preview. SubIFD is the raw image. SubIFD1 is a 2016x1512 sky segmentation mask (urn:com:apple:photo:2020:aux:semanticskymatte), and it holds the file's only XMP. EXIF, GPS and 20 Apple maker note tags hang off IFD0 as usual.
The preview keeps its own copy
The JPEG preview in IFD0 is a complete JPEG file with its own EXIF block, GPS and Apple maker notes included. Stripping the DNG does not touch it. After exiftool -all= the DNG itself had no GPS left, and exiftool -b -PreviewImage still extracted a JPEG with the coordinates. Anyone sharing ProRAW files should strip the preview too:
exiftool -b -PreviewImage IMG_1361.DNG > preview.jpg
exiftool -all= preview.jpg
exiftool "-PreviewImage<=preview.jpg" IMG_1361.DNGThe preview loses its ICC profile in the process, so its colors may shift slightly until a raw editor regenerates it. Other raw files deserve the same check, although the Canon CR2 preview tested here carried no EXIF of its own. More in how to remove location from photos.
Writing DNG metadata
Lightroom Classic writes XMP straight into DNG, JPEG, TIFF and PSD files, and into sidecars for proprietary raw. Changes reach the file through Metadata > Save Metadata To File, or automatically with Catalog Settings > Metadata > Automatically Write Changes Into XMP. Metadata > Update DNG Previews & Metadata also rebuilds the embedded preview from the current settings.
ExifTool writes DNG directly. One quirk with ProRAW: ExifTool 12.76 writing -XMP-dc:Creator added the value to the XMP in SubIFD1 and to a new XMP block in IFD0, so the creator appeared twice. For copyright, -IFD0:Copyright and -XMP-dc:Rights are the unambiguous targets.
A full strip is partial by design. exiftool -all= printed Warning: [minor] Can't delete IFD0 from DNG, then removed GPS, the ExifIFD, the maker notes and the XMP while keeping Make, Model and the color tags a raw converter needs. ImageMagick still decoded the result.
Using our tools with a DNG file
DNG uploads are not accepted here, and converting to JPEG to use our metadata editor throws away the raw data, which is the point of the format. Keep the DNG as the master and edit it with ExifTool or Lightroom. If you need a JPEG for delivery, export it from a raw editor, then check what the export kept with the EXIF reader.