Copy link to clipboard
Copied
Hi all,
I'm working on a program to wrap image info into a dng format, but have run into a snag that I cannot find in the documentation. I'll start off with the verbose output of dng_validate:
Uses little-endian byte order
Magic number = 42
IFD 0: Offset = 8, Entries = 20
NewSubFileType: Preview Image
ImageWidth: 62
ImageLength: 41
BitsPerSample: 8 8 8
Compression: Uncompressed
PhotometricInterpretation: RGB
Make: "Test Program"
Model: "V1"
StripOffsets: Offset = 386
Orientation: 1 - 0th row is top, 0th column is left
SamplesPerPixel: 3
RowsPerStrip: 41
StripByteCounts: Count = 7626
PlanarConfiguration: 1
Software: "Test"
DateTime: 1900:01:01 00:00:00
SubIFDs: IFD = 8012
DNGVersion: 1.4.0.0
DNGBackwardVersion: 1.1.0.0
UniqueCameraModel: "Test Program"
NextIFD = 0
SubIFD 1: Offset = 8012, Entries = 10
NewSubFileType: Main Image
ImageWidth: 1000
ImageLength: 667
BitsPerSample: 16 16 16
Compression: Uncompressed
PhotometricInterpretation: LinearRaw
StripOffsets: Offset = 8144
SamplesPerPixel: 3
RowsPerStrip: 667
StripByteCounts: Count = 4002000
NextIFD = 0
*** Error: Missing or invalid SamplesPerPixel (SubIFD 1) ***
So obviously SamplesPerPixel is present in SubIFD 1, and I've seen plenty of dngs that have LinearRaw with 3 channels. The image won't open in photoshop or in lightroom and I can't find any indication as to what the actual problem is. Help greatly appreciated. Thanks.
Copy link to clipboard
Copied
Your DNG is missing a whole lot of required tags. The specific error is probably because there aren't color matrixes, and I think that DNG_validate uses the size of the color matrixes to work out how many color planes there are. SamplesPerPixel of three only makes sense for three color planes.
Copy link to clipboard
Copied
Thanks for the reply. ColorMatrix1 was definitely missing, and its addition now passes dng_validate. Is there a reference for how the color matrix is calculated? In some use cases, I'm storing demosaicized RGB images in DNG as a temporary container, but they appear white-washed when opened.
Copy link to clipboard
Copied
There's whole chapter in the DNG specification on how the matrixes, etc work. You can download it from the Adobe website.