Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for cinema dng? #368

Open
devonstanczyk opened this issue Dec 16, 2023 · 40 comments
Open

Support for cinema dng? #368

devonstanczyk opened this issue Dec 16, 2023 · 40 comments
Labels
enhancement New feature or request

Comments

@devonstanczyk
Copy link

Hi there,

I shoot with a Sigma FP, CinemaDNG. Looking for a solution that preserves all metadata but applies lossless compression. Will this support Sigma FP and CDNG spec metadata?

@cytrinox
Copy link
Contributor

Cinema DNG is not yet supported.

@cytrinox cytrinox added the enhancement New feature or request label Dec 31, 2023
@devonstanczyk
Copy link
Author

What can I do to help?

@hanatos
Copy link

hanatos commented Feb 20, 2024

fwiw this rawspeed issue seems to be related: darktable-org/rawspeed#189

edit: ignore me. cytrinox already has support in rawler for the updated prediction models. the issue with files such as these: https://discuss.pixls.us/t/cinemadng-workflow-for-blackmagic-or-sigma-fp-cameras-in-darktable/42191 appears to be that it uses tiling in a way that confuses the decoder. somehow it tries to decode the tiles into an image that has a quarter of the width and half the height or so. i'm a bit confused about the various resolutions and potential doubling factors involved here.

@devonstanczyk
Copy link
Author

Maybe this is helpful.

https://thndl.com/how-dng-compresses-raw-data-with-lossless-jpeg92.html

Under the "How does DNG use LJ92?" section.

@hanatos
Copy link

hanatos commented Feb 21, 2024

for the record, i think the blackmagic way of de-swizzling the decoded jpg data is required, as outlined here: darktable-org/rawspeed#334 (comment)

i think cytrinox is well aware of this but probably doesn't have the time/priority for it, but i'll leave the link here maybe someone else has in the meantime..

@jedypod
Copy link

jedypod commented Mar 1, 2024

I'm not sure if it helps, but if I try to convert a 12 bit cinema dng image from a SIGMA fp I get this error:

dnglab -v convert A002_651_20240229_000001_2k_12bit.DNG out.dng 
Creating output directory ''
[ERROR ][dnglab_lib::jobs::raw2dng] Failed to decode file: DNG: Don't know about 12 bps images (bin/dnglab/dnglab-lib/src/jobs/raw2dng.rs:85)
Status: Failed: 'A002_651_20240229_000001_2k_12bit.DNG', Decoder failed: DNG: Don't know about 12 bps images

Test raw dng files from the camera shot in cinema mode are available here: https://drive.google.com/drive/folders/1YXz9rU3lpQJkaKTDzU00j2fA8K0VMpo8

8 bit dng variants seem to convert to dng but the output is quite a bit larger than the input image.. not sure why.

It would be really cool and useful to be able to specify the transfer function and bit depth of the output dng, as well as enabling lossless jpg compression. For example storing the 12 bit dng as 10 bit log encoded would reduce filesize while preserving quality.

@kmilos
Copy link

kmilos commented Mar 3, 2024

As mentioned in the discuss.pixls.us thread, the Sigma scheme is different to Blackmagic, so this is probably better split up in several issues/feature requests.

To sum it up, this is missing:

  1. Sigma: support for packed 10/12/14 bitstream (regular uncompressed TIFFs, so this is a must have anyway)

  2. Blackmagic lossless: lj92 w/ predictor 6, with additional row deinterleaving (tile reshaped from W x H to 2W x H/2)

The latter would also cover recent DJI drone raw video output as well.

In addition there is the custom Blackmagic lossy extension (sctrictly speaking breaking the DNG spec because of piggybacking the compression tag in an "illegal" way):

  1. Blackmagic 3:1/4:1: tile reshaping as above, just using 12b JPEG extended sequential DCT instead

@cytrinox
Copy link
Contributor

cytrinox commented Mar 3, 2024

Theoretically, BPS=12 is already supported but due a bug dnglab could not handle BPS=12 for Little-Endian files. Fixed in #407
ljpeg92 implementation in dnglab/rawler already supports all predictor modes and row deinterleaving but proper LinearizationTable support for DNG is not yet fully implemented (PR in progress).
I don't see any conrete problems to support Sigma/Blackmagic raws in dnglab as soon as the outstanding bugs are fixed.

I've checked the 3:1/4:1 BlackMagic DNGs - IMHO these files violates DNG spec. Even Adobe software can't open them. I've no intention to "fix" Blackmagic bugs, so support for these specific compression modes are out of scope for me.

@jedypod
Copy link

jedypod commented Mar 3, 2024

Thank you for the fix for 12 bit cinema dng files from the Sigma fp.

I tried compiling dnglab from main with #407 merged, and the behavior is still the same for 10 bit images (The Sigma fp can shoot 8, 10, and 12 bit cinema dng images in cinema mode).

dnglab convert -c lossless --dng-preview true -f A002_648_20240229_000001_4k_10bit.DNG test.dng
[ERROR ][dnglab_lib::jobs::raw2dng] Failed to decode file: DNG: Don't know about 10 bps images (bin/dnglab/dnglab-lib/src/jobs/raw2dng.rs:85)
Converted 0/1 files, 1 failed:
   A002_648_20240229_000001_4k_10bit.DNG
Total time: 0.17s

It would be nice to have 10 bit images supported as well if it is possible.

@devonstanczyk
Copy link
Author

devonstanczyk commented Mar 4, 2024

@jedypod from your sample files, how did you get 2K resolution? Are you using a lossy compression method?

@jedypod
Copy link

jedypod commented Mar 4, 2024

@devonstanczyk
All sample files are straight out of the camera. There is a 2k mode and a 4k mode, with 8, 10 and 12 bits data type. There are no options for compression in the camera. If I re-compress one of the 12bit dngs using dnglab and set it to ljpeg92 lossless compression it ends up the same filesize (uncompressed is significantly bigger), so I assume the camera is using that compression method or something similar to it.

Hopefully that helps, let me know if I can clarify or expand on anything! Happy to help if I can.

@devonstanczyk
Copy link
Author

@jedypod are you using the original sigma FP or FPL?

@jedypod
Copy link

jedypod commented Mar 4, 2024

@devonstanczyk it's the original sigma fp

@jedypod
Copy link

jedypod commented Mar 6, 2024

Just wanted to follow up on this. I compiled dnglab from main with #408 merged and tested it with the sigma fp test frames.

10 bit frames work perfectly now, thanks so much for the fix!

If I re-compress one of the 12bit dngs using dnglab and set it to ljpeg92 lossless compression it ends up the same filesize

I think I made a mistake before. I'm not sure what I was doing wrong, but I am now quite certain that the raw dng frames out of the camera are uncompressed. Using dnglab to re-encode them with lossless LJpeg92 compression massively reduces the disk usage, which is really awesome. Using something like the following command:

dnglab convert -f --compression lossless --dng-preview false --dng-thumbnail false --embed-raw false --ljpeg92-predictor 7 A002_647_20240229_000001_4k_12bit.DNG A002_647_20240229_000001_4k_12bit_LJ92.DNG

Here's a summary of compressed sizes using the different LJ92 predictor levels for this example frame:

$ du --apparent-size -h A002_647_*
13M     A002_647_20240229_000001_4k_12bit.DNG
4.7M    A002_647_20240229_000001_4k_12bit_LJ92_1.dng
7.9M    A002_647_20240229_000001_4k_12bit_LJ92_2.dng
8.1M    A002_647_20240229_000001_4k_12bit_LJ92_3.dng
4.8M    A002_647_20240229_000001_4k_12bit_LJ92_4.dng
4.6M    A002_647_20240229_000001_4k_12bit_LJ92_5.dng
4.6M    A002_647_20240229_000001_4k_12bit_LJ92_6.dng
4.4M    A002_647_20240229_000001_4k_12bit_LJ92_7.dng

I'm not sure exactly what the predictor size does.. reading this article I guess maybe it's the window size or how many pixels to look at? The default of 1 seems good, but 7 seems to compress slightly better for the frames I tested.

Anyway I just wanted to follow up.

TLDR;
This is awesome! Thank you!!

@devonstanczyk
Copy link
Author

@jedypod so everything is working with Sigma FP DNGs? Where can I find the build?

@jedypod
Copy link

jedypod commented Mar 7, 2024

@devonstanczyk I just compiled from the main branch of the git repo using cargo. Very easy..

One unfortunate thing I realized after testing a bit more is that Resolve won't load the compressed DNGs. It does not seem to be related to the compression because I have other 14bit lj92 compressed dngs which work fine. Maybe it's the 10 and 12 bit variations that break it... :/

@devonstanczyk
Copy link
Author

Bummer! Thanks for testing though! - Could it be that DNGlab is creating linear DNGs (no RAW sensor data)?

@jedypod
Copy link

jedypod commented Mar 7, 2024

Could it be that DNGlab is creating linear DNGs (no RAW sensor data)?

I don't think so. I compared the raw bayer data dumped out using dcraw_emu of the original uncompressed image data from the sigma fp, and the lj92 compressed image rendered out with dnglab, and the results are identical.

I dug up some old raw images shot with magic lantern on a Canon 60D, to see if the behavior is the same in resolve. Magic Lantern shoots raw video in the MLV format, and you can save out dng frames using software like MLVApp. I found an old MLV that is 12 bit, to see if it not working with resolve is because of the combination of bit depth and LJ92 compression.

  • First as a baseline I saved out an uncompressed dng frame from the original mlv file: M23-0133_000000.dng
  • Then I saved out an LJ92 compressed dng frame again using MLVapp: M23-0133_000000_lj92_mlvapp.dng

Both of these images load fine in Resolve.

Then I wanted to test the same dng compressed to LJ92 with dnglab, but I'm getting an error:

[ERROR ][rawler::decoders::mrw] is_mrw() error: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" } (rawler/src/decoders/mrw.rs:41)
[ERROR ][rawler::formats::jfif] is_jfif(): Error { kind: UnexpectedEof, message: "failed to fill whole buffer" } (rawler/src/formats/jfif.rs:308)
[ERROR ][rawler::formats::jfif] is_exif(): Error { kind: UnexpectedEof, message: "failed to fill whole buffer" } (rawler/src/formats/jfif.rs:318)
[ERROR ][dnglab_lib::jobs::raw2dng] Unsupported file: "M23-0133_000000_.dng"
File is unsupported: No decoder found, model '', make: '', mode: ''
Please report this issue at 'https://github.com/dnglab/dnglab/issues'! (bin/dnglab/dnglab-lib/src/jobs/raw2dng.rs:82)
Converted 0/1 files, 1 failed:
   M23-0133/M23-0133_000000.dng
Total time: 0.05s

It looks like it doesn't like the lack of proper camera metadata, which is unfortunate. It seems like it could still carry on and try to process the file.. but maybe there is some technical reason for the fail I don't understand. I even tried copying the metadata from a CR2 image shot with the same camera over to this dng, but am still getting the same error...

Anyway, it would be great to see if we could track down why resolve doesn't like those LJ92 compressed DNG files rendered out with dnglab.

Here are the two test images i described above if it helps:
M23-0133.zip

@devonstanczyk
Copy link
Author

Awesome findings! Agreed, if Cinema DNGs processed with DNGlab are unusable in DaVinci, that's a bummer.

Are you noticing if the bit depth stays the same after processing with DNGlab? For example, whenever I would use Adobe DNG converter, it would strip all cinema related Metadata (timecode, etc.), and convert any bit depth up to 16 bit. This conversion obviously is a pointless expansion of 12 bit data to fit into 16 bit. The lack of cinema metadata tags is a huge headache too after using Adobe DNG Converter.

SlimRAW does an amazing job at leaving all data intact, and only focusing on lossless compression or lossy compression to the RAW data.

@cytrinox
Copy link
Contributor

cytrinox commented Mar 7, 2024

Latest merge requests #411 and #412 should address all issues and also adds support for keeping Timecodes, FrameRate etc.

@devonstanczyk
Copy link
Author

devonstanczyk commented Mar 8, 2024

Thank you @cytrinox! Forgive me, but how can I install #411 or #412 on Mac? @jedypod

@jedypod
Copy link

jedypod commented Mar 8, 2024

Latest merge requests #411 and #412 should address all issues

@cytrinox This is great! I'm not sure if you are including the (probably out of scope) issues of the dngs output from dnglab not loading in resolve, or the dngs output from MLVApp failing to load in dnglab.. but I compiled again from main and both of these still seem to have the same behavior.

Are you noticing if the bit depth stays the same after processing with DNGlab?

Yes the bitdepth stays the same after LJ92 compression, which is great. I could see it being useful being able to specify the output bitdepth though. For example if a user wanted to take a 12 bit dng and compress and encode to a 10 bit output using a log linearization table or something like that.

Interestingly, if you process an uncompressed output with dnglab it looks like the bitdepth is increased to 16 bit. For example, processing A002_651_20240229_000001_2k_12bit.DNG using

dnglab convert -f --compression uncompressed --dng-preview false --dng-thumbnail false --embed-raw false A002_651_20240229_000001_2k_12bit.DNG A002_651_20240229_000001_2k_12bit_uncompressed_dnglab.DNG

seems to result in a 16bit dng output (if exiftool's reporting can be trusted). I'll attach these two dngs in a zip file if it helps: A002_651_20240229_000001.zip

Even more interesting, this uncompressed dng also doesn't load in Resolve, so it must not be related to the LJ92 compression... Maybe there is something in the metadata or the way the dng is encoded that makes A002_651_20240229_000001_2k_12bit.DNG load fine in resolve and A002_651_20240229_000001_2k_12bit_uncompressed_dnglab.DNG not load at all...

how can I install #411 or #412 on Mac?

@devonstanczyk If you can get cargo (the rust build system) installed on your computer (maybe this guide would help?), compiling dnglab is as simple as

git clone https://github.com/dnglab/dnglab.git
cd dnglab
cargo build --release

if all goes well, the compiled binary will be in target/release/dnglab.

@devonstanczyk
Copy link
Author

Thanks @jedypod!

What if you took an uncompressed DNG straight from the memory card, and ran it through adobe DNG converter, and then through DNGLab. You could then compare how the data differs between the two. Maybe compare them with exiftool tool too to check metadata as well. Maybe this could lead to an answer.

Use a simple code editor like BBedit to find/compare the differences in data.

@devonstanczyk
Copy link
Author

Just getting around to testing. I've installed both Rust and DNGlab. Everytime I try to run a command, I get "command not found: dnglab"

I'm no newb when it comes to imaging, but I'm certainly a CLI newb :/

@jedypod
Copy link

jedypod commented Mar 12, 2024

You would have to copy the dnglab binary in the release folder to some folder that is on your $PATH env var. maybe /usr/local/bin, of if you want to make your own, modify your $PATH variable to prepend a path of your choosing and put the binary in there. Or you can execute the file directly with something like ./dnglab if you are cd'd into the folder with it in there. Hope that gives you some hints to get the answers you need.

@devonstanczyk
Copy link
Author

Using my own Cinema DNG 12bit images from my Sigma FP, I ran the following code: dnglab convert -f --compression lossless --dng-preview false --dng-thumbnail false --embed-raw false --ljpeg92-predictor 6 A001_091_20240311_000001.DNG A001_091_20240311_000001_Lossless.DNG and received an output.

@jedypod I am having similar issues with DaVinci Resolve. The new lossless DNG does not load correctly into DaVinci Resolve.

I am going to convert the original DNG with Adobe DNG Converter, then compare the metadata of it, to the DNG from DNGlab, and original unmodified DNG. I'll output text files from EXIFtool. Using the diff command will show differences in the text and show what's present/missing.

Adobe-DNG-Converter-DNG.txt
DNGlab-Lossless-DNG.txt
Unmodified-DNG.txt

@devonstanczyk
Copy link
Author

devonstanczyk commented Mar 21, 2024

@cytrinox Found some interesting things. When loading DNG's from DNGlab and DNG's from Adobe DNG Converter into Adobe Camera RAW:

  • DNG's converted with Adobe DNG Converter; show Adobe's RAW profiles for selection
  • DNG's converted with DNGlab; show Adobe's "non-RAW" profiles for selection

Typically when Adobe's non-RAW profiles are the only ones selectable, it often means that the image isn't RAW/RAW sensor data/is a raster image.

Is DNGlab creating "linear DNGs"? That is, demosaiced output? A little more info on Linear DNG here https://helpx.adobe.com/camera-raw/using/adobe-dng-converter.html (Search for "linear" in the page to find the bullet point.)

Separate from above; after evaluating output from DNGlab with EXIF tool, I noticed that the "default crop" tag is set to 3832x2155 when it should be 3840x2160.

@devonstanczyk
Copy link
Author

devonstanczyk commented Mar 25, 2024

Did another test. Shot on Sigma FP, cinema DNG, 24FPS, 12bpc.

I took the original DNG from the Sigma FP, ran it through DNGlab several times testing each predictor using the following command: dnglab convert -f --compression lossless --dng-preview false --dng-thumbnail false --embed-raw false --ljpeg92-predictor X

Within Davinci Resolve, I've imported each DNG. The DNG's from DNGlab are not loading correctly in Davinci Resolve. They are also reporting the wrong resolution (2048x1556), and reporting 10bit.

I had another idea: I ran the DNG's converted from DNGlab, through Adobe DNG Converter, and they loaded correctly. Although they are loading in as 3832x2155 (mentioned in the above comment).

See attached image for a screenshot from Davinci Resolve and how it's interpreting the data.

Screenshot 2024-03-24 at 9 40 26 PM

@cytrinox
Copy link
Contributor

Recently I've merged two PRs fixing minor issues with EXIF tags and DNG crop, but I don't think these are the root cause for Resolve problems.

@jedypod
Copy link

jedypod commented Mar 30, 2024

@cytrinox I have a hunch about why resolve does not read dng images created by dnglab.

I'll start with A002_652_20240229_000001_2k_10bit.DNG (see attached zip file: files.zip ).

First I'll create a compressed dng using dnglab.

dnglab convert --compression lossless --dng-preview false --dng-thumbnail false --embed-raw false --ljpeg92-predictor 7 A002_652_20240229_000001_2k_10bit.DNG A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng

Trying to load both of these dngs into resolve: the original A002_652_20240229_000001_2k_10bit.DNG loads fine. The compressed dng A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng does not load in resolve, and as @devonstanczyk pointed out, the resolution is reported incorrectly.

Inspecting the structure of the dng using the following exiv2 commands,

exiv2 -p R A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng > A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng.exiv2_structure.txt
exiv2 -p R A002_652_20240229_000001_2k_10bit.DNG > A002_652_20240229_000001_2k_10bit.DNG.exiv2_structure.txt

(These txt files are also in the zip file)

it looks like the dnglab generated dng has multiple sub-images, while the original has only one. I'm not sure if I'm using the right terminology here as I'm not very familiar with the technical aspects of the file format. I'm just wondering if Cinema DNG is not meant to have image data stored in subimages maybe?

Structure of original

STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit.DNG
 address |    tag                              |      type |    count |    offset | value
      10 | 0x00fe NewSubfileType               |      LONG |        1 |           | 0
      22 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1936
      34 | 0x0101 ImageLength                  |      LONG |        1 |           | 1090
      46 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 10
      58 | 0x0103 Compression                  |     SHORT |        1 |           | 1
      70 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 32803
      82 | 0x010e ImageDescription             |     ASCII |       64 |       710 | ............................... ...
      94 | 0x010f Make                         |     ASCII |        6 |       774 | SIGMA
     106 | 0x0110 Model                        |     ASCII |       11 |       780 | SIGMA fp..
     118 | 0x0111 StripOffsets                 |      LONG |        1 |           | 78848
     130 | 0x0112 Orientation                  |     SHORT |        1 |           | 1
     142 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 1
     154 | 0x0116 RowsPerStrip                 |      LONG |        1 |           | 1090
     166 | 0x0117 StripByteCounts              |      LONG |        1 |           | 2637812
     178 | 0x011a XResolution                  |  RATIONAL |        1 |       792 | 72/1
     190 | 0x011b YResolution                  |  RATIONAL |        1 |       800 | 72/1
     202 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
     214 | 0x0128 ResolutionUnit               |     SHORT |        1 |           | 2
     226 | 0x0131 Software                     |     ASCII |       25 |       808 | SIGMA fp Ver.5.00.0.V89 
     238 | 0x0132 DateTime                     |     ASCII |       20 |       834 | 2024:02:29 19:10:08
     250 | 0x013b Artist                       |     ASCII |       64 |       854 | ............................... ...
     262 | 0x828d CFARepeatPatternDim          |     SHORT |        2 |           | 2 2
     274 | 0x828e CFAPattern                   |      BYTE |        4 |           | ....
     286 | 0x8298 Copyright                    |     ASCII |       64 |       918 | ............................... ...
     298 | 0x8769 ExifTag                      |      LONG |        1 |           | 16676
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit.DNG
   address |    tag                              |      type |    count |    offset | value
     16678 | 0x829a ExposureTime                 |  RATIONAL |        1 |     17246 | 1/50
     16690 | 0x829d FNumber                      |  RATIONAL |        1 |     17254 | 0/10
     16702 | 0x8822 ExposureProgram              |     SHORT |        1 |           | 1
     16714 | 0x8827 ISOSpeedRatings              |     SHORT |        1 |           | 3200
     16726 | 0x8830 SensitivityType              |     SHORT |        1 |           | 2
     16738 | 0x8832 RecommendedExposureIndex     |      LONG |        1 |           | 3200
     16750 | 0x9000 ExifVersion                  | UNDEFINED |        4 |           | 0231
     16762 | 0x9003 DateTimeOriginal             |     ASCII |       20 |     17262 | 2024:02:29 19:10:08
     16774 | 0x9004 DateTimeDigitized            |     ASCII |       20 |     17282 | 2024:02:29 19:10:08
     16786 | 0x9010 OffsetTime                   |     ASCII |        7 |     17302 | -04:00
     16798 | 0x9011 OffsetTimeOriginal           |     ASCII |        7 |     17310 | -04:00
     16810 | 0x9012 OffsetTimeDigitized          |     ASCII |        7 |     17318 | -04:00
     16822 | 0x9201 ShutterSpeedValue            | SRATIONAL |        1 |     17326 | 365946/65535
     16834 | 0x9202 ApertureValue                |  RATIONAL |        1 |     17334 | 0/65534
     16846 | 0x9203 BrightnessValue              | SRATIONAL |        1 |     17342 | 4294735111/65534
     16858 | 0x9204 ExposureBiasValue            | SRATIONAL |        1 |     17350 | 0/10
     16870 | 0x9205 MaxApertureValue             |  RATIONAL |        1 |     17358 | 0/65534
     16882 | 0x9206 SubjectDistance              |  RATIONAL |        1 |     17366 | 0/10
     16894 | 0x9207 MeteringMode                 |     SHORT |        1 |           | 5
     16906 | 0x9208 LightSource                  |     SHORT |        1 |           | 0
     16918 | 0x9209 Flash                        |     SHORT |        1 |           | 48
     16930 | 0x920a FocalLength                  |  RATIONAL |        1 |     17374 | 0/10
     16942 | 0x927c MakerNote                    | UNDEFINED |    54338 |     17684 | SIGMA.....a..........I......... ...

Structure of dnglab generated dng image

STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng
 address |    tag                              |      type |    count |    offset | value
  917726 | 0x010f Make                         |     ASCII |        6 |    907920 | SIGMA
  917738 | 0x0110 Model                        |     ASCII |        9 |    907928 | SIGMA fp
  917750 | 0x0112 Orientation                  |     SHORT |        1 |           | 1
  917762 | 0x0131 Software                     |     ASCII |       17 |    907940 | dnglab_lib 0.6.0
  917774 | 0x0132 DateTime                     |     ASCII |       20 |    907960 | 2024:03:30 13:47:00
  917786 | 0x013b Artist                       |     ASCII |        1 |           | 
  917798 | 0x014a SubIFDs                      |      LONG |        1 |           | 907108
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng
   address |    tag                              |      type |    count |    offset | value
    907110 | 0x00fe NewSubfileType               |     SHORT |        1 |           | 0
    907122 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1936
    907134 | 0x0101 ImageLength                  |      LONG |        1 |           | 1090
    907146 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 10
    907158 | 0x0103 Compression                  |     SHORT |        1 |           | 7
    907170 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 32803
    907182 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 1
    907194 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
    907206 | 0x0142 TileWidth                    |     SHORT |        1 |           | 256
    907218 | 0x0143 TileLength                   |     SHORT |        1 |           | 256
    907230 | 0x0144 TileOffsets                  |      LONG |       40 |    894136 | 8 22208 43988 69564 89836 ...
    907242 | 0x0145 TileByteCounts               |      LONG |       40 |    894296 | 22199 21779 25575 20271 21535 ...
    907254 | 0x0153 SampleFormat                 |     SHORT |        3 |    894456 | 1 1 1
    907266 | 0x828d CFARepeatPatternDim          |     SHORT |        2 |           | 2 2
    907278 | 0x828e CFAPattern                   |      BYTE |        4 |           | ....
    907290 | 0xc616 CFAPlaneColor                |      BYTE |        3 |           | ...
    907302 | 0xc617 CFALayout                    |     SHORT |        1 |           | 1
    907314 | 0xc619 BlackLevelRepeatDim          |     SHORT |        2 |           | 2 2
    907326 | 0xc61a BlackLevel                   |  RATIONAL |        4 |    894464 | 65516/1024 65516/1024 65516/1024 65516/1024
    907338 | 0xc61d WhiteLevel                   |     SHORT |        1 |           | 1023
    907350 | 0xc61e DefaultScale                 |  RATIONAL |        2 |    894496 | 1/1 1/1
    907362 | 0xc61f DefaultCropOrigin            |     SHORT |        2 |           | 8 5
    907374 | 0xc620 DefaultCropSize              |     SHORT |        2 |           | 1920 1080
    907386 | 0xc65c BestQualityScale             |  RATIONAL |        1 |    894512 | 1/1
    907398 | 0xc68d ActiveArea                   |     SHORT |        4 |    894520 | 0 0 1090 1936
    907410 | 0xc74e OpcodeList3                  | UNDEFINED |    12564 |    894528 | ........................?...... ...
    907422 | 0xc761 NoiseProfile                 |    DOUBLE |        2 |    907092 | 
  END A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng
  917810 | 0x8298 Copyright                    |     ASCII |        1 |           | 
  917822 | 0x8769 ExifTag                      |      LONG |        1 |           | 907588
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng
   address |    tag                              |      type |    count |    offset | value
    907590 | 0x829a ExposureTime                 |  RATIONAL |        1 |    907440 | 1/50
    907602 | 0x829d FNumber                      |  RATIONAL |        1 |    907448 | 0/10
    907614 | 0x8822 ExposureProgram              |     SHORT |        1 |           | 1
    907626 | 0x8827 ISOSpeedRatings              |     SHORT |        1 |           | 3200
    907638 | 0x8830 SensitivityType              |     SHORT |        1 |           | 2
    907650 | 0x8832 RecommendedExposureIndex     |      LONG |        1 |           | 3200
    907662 | 0x9000 ExifVersion                  | UNDEFINED |        4 |           | 0220
    907674 | 0x9003 DateTimeOriginal             |     ASCII |       20 |    907456 | 2024:02:29 19:10:08
    907686 | 0x9004 DateTimeDigitized            |     ASCII |       20 |    907476 | 2024:02:29 19:10:08
    907698 | 0x9010 OffsetTime                   |     ASCII |        7 |    907496 | -04:00
    907710 | 0x9011 OffsetTimeOriginal           |     ASCII |        7 |    907504 | -04:00
    907722 | 0x9012 OffsetTimeDigitized          |     ASCII |        7 |    907512 | -04:00
    907734 | 0x9201 ShutterSpeedValue            | SRATIONAL |        1 |    907520 | 365946/65535
    907746 | 0x9202 ApertureValue                |  RATIONAL |        1 |    907528 | 0/65534
    907758 | 0x9203 BrightnessValue              | SRATIONAL |        1 |    907536 | 4294735111/65534
    907770 | 0x9204 ExposureBiasValue            | SRATIONAL |        1 |    907544 | 0/10
    907782 | 0x9205 MaxApertureValue             |  RATIONAL |        1 |    907552 | 0/65534
    907794 | 0x9206 SubjectDistance              |  RATIONAL |        1 |    907560 | 0/10
    907806 | 0x9207 MeteringMode                 |     SHORT |        1 |           | 5
    907818 | 0x9208 LightSource                  |     SHORT |        1 |           | 0
    907830 | 0x9209 Flash                        |     SHORT |        1 |           | 48
    907842 | 0x920a FocalLength                  |  RATIONAL |        1 |    907568 | 0/10
    907854 | 0xa001 ColorSpace                   |     SHORT |        1 |           | 1
    907866 | 0xa402 ExposureMode                 |     SHORT |        1 |           | 1
    907878 | 0xa403 WhiteBalance                 |     SHORT |        1 |           | 1
    907890 | 0xa406 SceneCaptureType             |     SHORT |        1 |           | 0
    907902 | 0xa431 BodySerialNumber             |     ASCII |        9 |    907576 | 91415977
  END A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng
  917834 | 0xc612 DNGVersion                   |      BYTE |        4 |           | ...
  917846 | 0xc613 DNGBackwardVersion           |      BYTE |        4 |           | ...
  917858 | 0xc614 UniqueCameraModel            |     ASCII |       15 |    907980 | SIGMA SIGMA fp
  917870 | 0xc621 ColorMatrix1                 | SRATIONAL |        9 |    907996 | 14643/10000 4294959785/10000 4294962194/10000 4294963966/10000 11711/10000 ...
  917882 | 0xc622 ColorMatrix2                 | SRATIONAL |        9 |    908068 | 8252/10000 4294965252/10000 4294965552/10000 4294962335/10000 11648/10000 ...
  917894 | 0xc628 AsShotNeutral                |  RATIONAL |        3 |    908140 | 50693/100000 100000/100000 59813/100000
  917906 | 0xc62a BaselineExposure             | SRATIONAL |        1 |    908164 | 1024/1024
  917918 | 0xc62b BaselineNoise                |  RATIONAL |        1 |    908172 | 10/10
  917930 | 0xc62c BaselineSharpness            |  RATIONAL |        1 |    908180 | 10/10
  917942 | 0xc62f CameraSerialNumber           |     ASCII |        9 |    908188 | 91415977
  917954 | 0xc634 DNGPrivateData               |      BYTE |     6734 |    908200 | SIGMA_EXTH_SPPA.z.............. ...
  917966 | 0xc635 MakerNoteSafety              |     SHORT |        1 |           | 0
  917978 | 0xc65a CalibrationIlluminant1       |     SHORT |        1 |           | 17
  917990 | 0xc65b CalibrationIlluminant2       |     SHORT |        1 |           | 21
  918002 | 0xc6f9 ProfileHueSatMapDims         |      LONG |        3 |    914936 | 36 2 1
  918014 | 0xc6fa ProfileHueSatMapData1        |     FLOAT |      216 |    914948 |  ...
  918026 | 0xc6fb ProfileHueSatMapData2        |     FLOAT |      216 |    915812 |  ...
  918038 | 0xc6fc ProfileToneCurve             |     FLOAT |      256 |    916676 |  ...
  918050 | 0xc6fd ProfileEmbedPolicy           |      LONG |        1 |           | 1
  918062 | 0xc763 TimeCodes                    |      BYTE |        8 |    917700 | .'.....
  918074 | 0xc764 FrameRate                    | SRATIONAL |        1 |    917708 | 24000/1000
  918086 | 0xc772 TStop                        |  RATIONAL |        1 |    917716 | 0/10
END A002_652_20240229_000001_2k_10bit_dnglab_compressed.dng

@devonstanczyk weirdly, for me a dng generated by Adobe DNG Converter 9.3 on windows does not display correctly in Resolve (18.5.1 on linux) either, though the resolution is reported correctly (though with a different crop than the original like you discovered).

@cytrinox
Copy link
Contributor

Does it load with --compression uncompressed --dng-thumbnail true?

@jedypod
Copy link

jedypod commented Mar 30, 2024

@cytrinox Hm, no it seems like the behavior in resolve is the same with

dnglab convert --compression uncompressed --dng-preview true --dng-thumbnail true --embed-raw false --ljpeg92-predictor 7 A002_652_20240229_000001_2k_10bit.DNG A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng

exiv2 -p R A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng > A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng.exiv2_structure.txt

The structure also seems to be the same:

STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
 address |    tag                              |      type |    count |    offset | value
 4771970 | 0x00fe NewSubfileType               |     SHORT |        1 |           | 1
 4771982 | 0x0100 ImageWidth                   |      LONG |        1 |           | 213
 4771994 | 0x0101 ImageLength                  |      LONG |        1 |           | 120
 4772006 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 8
 4772018 | 0x0103 Compression                  |     SHORT |        1 |           | 1
 4772030 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 2
 4772042 | 0x010f Make                         |     ASCII |        6 |   4762148 | SIGMA
 4772054 | 0x0110 Model                        |     ASCII |        9 |   4762156 | SIGMA fp
 4772066 | 0x0111 StripOffsets                 |      LONG |        1 |           | 4684988
 4772078 | 0x0112 Orientation                  |     SHORT |        1 |           | 1
 4772090 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
 4772102 | 0x0116 RowsPerStrip                 |      LONG |        1 |           | 120
 4772114 | 0x0117 StripByteCounts              |      LONG |        1 |           | 76680
 4772126 | 0x0131 Software                     |     ASCII |       17 |   4762168 | dnglab_lib 0.6.0
 4772138 | 0x0132 DateTime                     |     ASCII |       20 |   4762188 | 2024:03:30 14:42:39
 4772150 | 0x013b Artist                       |     ASCII |        1 |           | 
 4772162 | 0x014a SubIFDs                      |      LONG |        2 |   4762208 | 4233248 4684836
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
   4233250 | 0x00fe NewSubfileType               |     SHORT |        1 |           | 0
   4233262 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1936
   4233274 | 0x0101 ImageLength                  |      LONG |        1 |           | 1090
   4233286 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 16
   4233298 | 0x0103 Compression                  |     SHORT |        1 |           | 1
   4233310 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 32803
   4233322 | 0x0111 StripOffsets                 |      LONG |        9 |   4220488 | 8 526600 1053192 1579784 2106376 ...
   4233334 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 1
   4233346 | 0x0116 RowsPerStrip                 |      LONG |        9 |   4220524 | 136 136 136 136 136 ...
   4233358 | 0x0117 StripByteCounts              |      LONG |        9 |   4220560 | 526592 526592 526592 526592 526592 ...
   4233370 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
   4233382 | 0x0153 SampleFormat                 |     SHORT |        3 |   4220596 | 1 1 1
   4233394 | 0x828d CFARepeatPatternDim          |     SHORT |        2 |           | 2 2
   4233406 | 0x828e CFAPattern                   |      BYTE |        4 |           | ....
   4233418 | 0xc616 CFAPlaneColor                |      BYTE |        3 |           | ...
   4233430 | 0xc617 CFALayout                    |     SHORT |        1 |           | 1
   4233442 | 0xc619 BlackLevelRepeatDim          |     SHORT |        2 |           | 2 2
   4233454 | 0xc61a BlackLevel                   |  RATIONAL |        4 |   4220604 | 65516/1024 65516/1024 65516/1024 65516/1024
   4233466 | 0xc61d WhiteLevel                   |     SHORT |        1 |           | 1023
   4233478 | 0xc61e DefaultScale                 |  RATIONAL |        2 |   4220636 | 1/1 1/1
   4233490 | 0xc61f DefaultCropOrigin            |     SHORT |        2 |           | 8 5
   4233502 | 0xc620 DefaultCropSize              |     SHORT |        2 |           | 1920 1080
   4233514 | 0xc65c BestQualityScale             |  RATIONAL |        1 |   4220652 | 1/1
   4233526 | 0xc68d ActiveArea                   |     SHORT |        4 |   4220660 | 0 0 1090 1936
   4233538 | 0xc74e OpcodeList3                  | UNDEFINED |    12564 |   4220668 | ........................?...... ...
   4233550 | 0xc761 NoiseProfile                 |    DOUBLE |        2 |   4233232 | 
  END A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
   4684838 | 0x00fe NewSubfileType               |     SHORT |        1 |           | 1
   4684850 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1024
   4684862 | 0x0101 ImageLength                  |      LONG |        1 |           | 576
   4684874 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 8
   4684886 | 0x0103 Compression                  |     SHORT |        1 |           | 7
   4684898 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 6
   4684910 | 0x0111 StripOffsets                 |      LONG |        1 |           | 4233566
   4684922 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
   4684934 | 0x0116 RowsPerStrip                 |      LONG |        1 |           | 576
   4684946 | 0x0117 StripByteCounts              |      LONG |        1 |           | 451259
   4684958 | 0x0153 SampleFormat                 |     SHORT |        3 |   4684828 | 1 1 1
   4684970 | 0xc71a PreviewColorSpace            |      LONG |        1 |           | 2
  END A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
 4772174 | 0x0153 SampleFormat                 |     SHORT |        3 |   4762216 | 1 1 1
 4772186 | 0x8298 Copyright                    |     ASCII |        1 |           | 
 4772198 | 0x8769 ExifTag                      |      LONG |        1 |           | 4761816
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
   4761818 | 0x829a ExposureTime                 |  RATIONAL |        1 |   4761668 | 1/50
   4761830 | 0x829d FNumber                      |  RATIONAL |        1 |   4761676 | 0/10
   4761842 | 0x8822 ExposureProgram              |     SHORT |        1 |           | 1
   4761854 | 0x8827 ISOSpeedRatings              |     SHORT |        1 |           | 3200
   4761866 | 0x8830 SensitivityType              |     SHORT |        1 |           | 2
   4761878 | 0x8832 RecommendedExposureIndex     |      LONG |        1 |           | 3200
   4761890 | 0x9000 ExifVersion                  | UNDEFINED |        4 |           | 0220
   4761902 | 0x9003 DateTimeOriginal             |     ASCII |       20 |   4761684 | 2024:02:29 19:10:08
   4761914 | 0x9004 DateTimeDigitized            |     ASCII |       20 |   4761704 | 2024:02:29 19:10:08
   4761926 | 0x9010 OffsetTime                   |     ASCII |        7 |   4761724 | -04:00
   4761938 | 0x9011 OffsetTimeOriginal           |     ASCII |        7 |   4761732 | -04:00
   4761950 | 0x9012 OffsetTimeDigitized          |     ASCII |        7 |   4761740 | -04:00
   4761962 | 0x9201 ShutterSpeedValue            | SRATIONAL |        1 |   4761748 | 365946/65535
   4761974 | 0x9202 ApertureValue                |  RATIONAL |        1 |   4761756 | 0/65534
   4761986 | 0x9203 BrightnessValue              | SRATIONAL |        1 |   4761764 | 4294735111/65534
   4761998 | 0x9204 ExposureBiasValue            | SRATIONAL |        1 |   4761772 | 0/10
   4762010 | 0x9205 MaxApertureValue             |  RATIONAL |        1 |   4761780 | 0/65534
   4762022 | 0x9206 SubjectDistance              |  RATIONAL |        1 |   4761788 | 0/10
   4762034 | 0x9207 MeteringMode                 |     SHORT |        1 |           | 5
   4762046 | 0x9208 LightSource                  |     SHORT |        1 |           | 0
   4762058 | 0x9209 Flash                        |     SHORT |        1 |           | 48
   4762070 | 0x920a FocalLength                  |  RATIONAL |        1 |   4761796 | 0/10
   4762082 | 0xa001 ColorSpace                   |     SHORT |        1 |           | 1
   4762094 | 0xa402 ExposureMode                 |     SHORT |        1 |           | 1
   4762106 | 0xa403 WhiteBalance                 |     SHORT |        1 |           | 1
   4762118 | 0xa406 SceneCaptureType             |     SHORT |        1 |           | 0
   4762130 | 0xa431 BodySerialNumber             |     ASCII |        9 |   4761804 | 91415977
  END A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
 4772210 | 0xc612 DNGVersion                   |      BYTE |        4 |           | ...
 4772222 | 0xc613 DNGBackwardVersion           |      BYTE |        4 |           | ...
 4772234 | 0xc614 UniqueCameraModel            |     ASCII |       15 |   4762224 | SIGMA SIGMA fp
 4772246 | 0xc621 ColorMatrix1                 | SRATIONAL |        9 |   4762240 | 14643/10000 4294959785/10000 4294962194/10000 4294963966/10000 11711/10000 ...
 4772258 | 0xc622 ColorMatrix2                 | SRATIONAL |        9 |   4762312 | 8252/10000 4294965252/10000 4294965552/10000 4294962335/10000 11648/10000 ...
 4772270 | 0xc628 AsShotNeutral                |  RATIONAL |        3 |   4762384 | 50693/100000 100000/100000 59813/100000
 4772282 | 0xc62a BaselineExposure             | SRATIONAL |        1 |   4762408 | 1024/1024
 4772294 | 0xc62b BaselineNoise                |  RATIONAL |        1 |   4762416 | 10/10
 4772306 | 0xc62c BaselineSharpness            |  RATIONAL |        1 |   4762424 | 10/10
 4772318 | 0xc62f CameraSerialNumber           |     ASCII |        9 |   4762432 | 91415977
 4772330 | 0xc634 DNGPrivateData               |      BYTE |     6734 |   4762444 | SIGMA_EXTH_SPPA.z.............. ...
 4772342 | 0xc635 MakerNoteSafety              |     SHORT |        1 |           | 0
 4772354 | 0xc65a CalibrationIlluminant1       |     SHORT |        1 |           | 17
 4772366 | 0xc65b CalibrationIlluminant2       |     SHORT |        1 |           | 21
 4772378 | 0xc6f9 ProfileHueSatMapDims         |      LONG |        3 |   4769180 | 36 2 1
 4772390 | 0xc6fa ProfileHueSatMapData1        |     FLOAT |      216 |   4769192 |  ...
 4772402 | 0xc6fb ProfileHueSatMapData2        |     FLOAT |      216 |   4770056 |  ...
 4772414 | 0xc6fc ProfileToneCurve             |     FLOAT |      256 |   4770920 |  ...
 4772426 | 0xc6fd ProfileEmbedPolicy           |      LONG |        1 |           | 1
 4772438 | 0xc763 TimeCodes                    |      BYTE |        8 |   4771944 | .'.....
 4772450 | 0xc764 FrameRate                    | SRATIONAL |        1 |   4771952 | 24000/1000
 4772462 | 0xc772 TStop                        |  RATIONAL |        1 |   4771960 | 0/10
END A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng

Hope it helps, and let me know if I can test anything else! Would love to get to the bottom of this...

@cytrinox
Copy link
Contributor

cytrinox commented Mar 31, 2024

I've merged PR #423 into main, this contains some minor fixes for DNG files. Thumbnails are written into root IFD, but if no thumbnail is available/written, RAW image could be written into root IFD instead of a sub IFD.
I figured out that Davinci Resolve won't load DNG files when root IFD contains no image.

I was able to load converted DNGs into DR with/without thumbnails/previews and all (1-7) different LJPEG predictors. The only thing I can't get work is uncompressed DNGs. Usually uncompressed data is split into multiple stripes. If I write one big stripe (that was Sigma Fp DNGs uses), DR would load the DNG. If I use multiple strips, DR rejects the image.

After some experiments, I would say this is a bug in DR, as all releveant tags are correct and multistrip DNGs are loading fine in a wide range of applications.

As Adobe DNG Converter usually writes multistrip DNGs when in settings "uncompressed dng" is choosen, someone could test if such files would load in DR or not.

@jedypod
Copy link

jedypod commented Mar 31, 2024

I compiled from main and tested again loading dnglab compressed dngs in resolve. It's working!! Thank you so much @cytrinox, this is awesome! This fix unlocks using dnglab for compression in my Sigma fp post workflow and is going to save me a literal crap-ton of disk space.

Out of curiosity I did a few more tests with Adobe DNG Converter 14.4. I don't think it's actually possible write out uncompressed dng images from that software. The only compression option I could find is "enable lossy compression", which seems to be something different.

Using these settings:
screenshot_2024-03-31_10-43-38
The resulting dng file is compressed with lj92 compression I believe. Here is a zip file with a "normal" dng export from adobe dng converter, and a lossy one for comparison, including the structure data exported using exiv2 -p R.. if it helps
A002_652_20240229_000001_2k_10bit_adng_lossless.zip

Interestingly, the non-lossy export from adobe dng converter also loads fine in resolve! (Not sure what I was doing wrong before).

@cytrinox
Copy link
Contributor

You have to choose custom at compatibility, then check "uncompressed".

@jedypod
Copy link

jedypod commented Mar 31, 2024

Ohh, got it! Thanks for the help. I saved out an uncompressed version of the same frame using Adobe DNG Converter. Surprisingly, this dng image also loads fine in Resolve. And I've confirmed that an uncompressed dng generated with dnglab does not load sucessfully in resolve.

If it helps, here is a zip file containing both images, and exiv2 structure info:
A002_652_20240229_000001_2k_10bit_uncompressed.zip

Adobe DNG structure:

STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
 address |    tag                              |      type |    count |    offset | value
      10 | 0x00fe NewSubfileType               |      LONG |        1 |           | 1
      22 | 0x0100 ImageWidth                   |      LONG |        1 |           | 256
      34 | 0x0101 ImageLength                  |      LONG |        1 |           | 144
      46 | 0x0102 BitsPerSample                |     SHORT |        3 |       674 | 8 8 8
      58 | 0x0103 Compression                  |     SHORT |        1 |           | 1
      70 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 2
      82 | 0x010f Make                         |     ASCII |        6 |       680 | SIGMA
      94 | 0x0110 Model                        |     ASCII |        9 |       686 | SIGMA fp
     106 | 0x0111 StripOffsets                 |      LONG |        1 |           | 153102
     118 | 0x0112 Orientation                  |     SHORT |        1 |           | 1
     130 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
     142 | 0x0116 RowsPerStrip                 |      LONG |        1 |           | 144
     154 | 0x0117 StripByteCounts              |      LONG |        1 |           | 110592
     166 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
     178 | 0x0131 Software                     |     ASCII |       35 |       696 | Adobe DNG Converter 14.4 (Window ...
     190 | 0x0132 DateTime                     |     ASCII |       20 |       732 | 2024:03:31 14:11:00
     202 | 0x014a SubIFDs                      |      LONG |        5 |       752 | 135006 148028 148420 149006 149528
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
    135008 | 0x00fe NewSubfileType               |      LONG |        1 |           | 0
    135020 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1936
    135032 | 0x0101 ImageLength                  |      LONG |        1 |           | 1090
    135044 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 16
    135056 | 0x0103 Compression                  |     SHORT |        1 |           | 1
    135068 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 32803
    135080 | 0x0111 StripOffsets                 |      LONG |        1 |           | 515584
    135092 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 1
    135104 | 0x0116 RowsPerStrip                 |      LONG |        1 |           | 1090
    135116 | 0x0117 StripByteCounts              |      LONG |        1 |           | 4220480
    135128 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
    135140 | 0x828d CFARepeatPatternDim          |     SHORT |        2 |           | 2 2
    135152 | 0x828e CFAPattern                   |      BYTE |        4 |           | ....
    135164 | 0xc616 CFAPlaneColor                |      BYTE |        3 |           | ...
    135176 | 0xc617 CFALayout                    |     SHORT |        1 |           | 1
    135188 | 0xc619 BlackLevelRepeatDim          |     SHORT |        2 |           | 2 2
    135200 | 0xc61a BlackLevel                   |  RATIONAL |        4 |    135336 | 16379/256 16379/256 16379/256 16379/256
    135212 | 0xc61d WhiteLevel                   |     SHORT |        1 |           | 1023
    135224 | 0xc61e DefaultScale                 |  RATIONAL |        2 |    135368 | 1/1 1/1
    135236 | 0xc61f DefaultCropOrigin            |  RATIONAL |        2 |    135384 | 8/1 5/1
    135248 | 0xc620 DefaultCropSize              |  RATIONAL |        2 |    135400 | 1920/1 1080/1
    135260 | 0xc62d BayerGreenSplit              |      LONG |        1 |           | 250
    135272 | 0xc632 AntiAliasStrength            |  RATIONAL |        1 |    135416 | 1/1
    135284 | 0xc65c BestQualityScale             |  RATIONAL |        1 |    135424 | 1/1
    135296 | 0xc68d ActiveArea                   |      LONG |        4 |    135432 | 0 0 1090 1936
    135308 | 0xc74e OpcodeList3                  | UNDEFINED |    12564 |    135448 | ........................?...... ...
    135320 | 0xc761 NoiseProfile                 |    DOUBLE |        2 |    148012 | 
  END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
    148030 | 0x00fe NewSubfileType               |      LONG |        1 |           | 1
    148042 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1024
    148054 | 0x0101 ImageLength                  |      LONG |        1 |           | 576
    148066 | 0x0102 BitsPerSample                |     SHORT |        3 |    148274 | 8 8 8
    148078 | 0x0103 Compression                  |     SHORT |        1 |           | 7
    148090 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 6
    148102 | 0x0111 StripOffsets                 |      LONG |        1 |           | 263694
    148114 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
    148126 | 0x0116 RowsPerStrip                 |      LONG |        1 |           | 576
    148138 | 0x0117 StripByteCounts              |      LONG |        1 |           | 42968
    148150 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
    148162 | 0x0211 YCbCrCoefficients            |  RATIONAL |        3 |    148280 | 299/1000 587/1000 114/1000
    148174 | 0x0212 YCbCrSubSampling             |     SHORT |        2 |           | 2 2
    148186 | 0x0213 YCbCrPositioning             |     SHORT |        1 |           | 0
    148198 | 0x0214 ReferenceBlackWhite          |  RATIONAL |        6 |    148304 | 0/1 255/1 128/1 255/1 128/1 ...
    148210 | 0xc716 PreviewApplicationName       |     ASCII |       20 |    148352 | Adobe DNG Converter
    148222 | 0xc717 PreviewApplicationVersion    |     ASCII |        5 |    148372 | 14.4
    148234 | 0xc719 PreviewSettingsDigest        |      BYTE |       16 |    148378 | ..9}\J.....pA.ou
    148246 | 0xc71a PreviewColorSpace            |      LONG |        1 |           | 2
    148258 | 0xc71b PreviewDateTime              |     ASCII |       26 |    148394 | 2024-03-31T14:11:00-07:00
  END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
    148422 | 0x00fe NewSubfileType               |      LONG |        1 |           | 1
    148434 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1920
    148446 | 0x0101 ImageLength                  |      LONG |        1 |           | 1080
    148458 | 0x0102 BitsPerSample                |     SHORT |        3 |    148630 | 8 8 8
    148470 | 0x0103 Compression                  |     SHORT |        1 |           | 34892
    148482 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 34892
    148494 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
    148506 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
    148518 | 0x0142 TileWidth                    |      LONG |        1 |           | 480
    148530 | 0x0143 TileLength                   |      LONG |        1 |           | 544
    148542 | 0x0144 TileOffsets                  |      LONG |        8 |    148636 | 306662 329884 350326 368760 390956 ...
    148554 | 0x0145 TileByteCounts               |      LONG |        8 |    148668 | 23221 20441 18434 22195 21098 ...
    148566 | 0xc61a BlackLevel                   |  RATIONAL |        3 |    148700 | 0/1 0/1 9/1
    148578 | 0xc716 PreviewApplicationName       |     ASCII |       20 |    148724 | Adobe DNG Converter
    148590 | 0xc717 PreviewApplicationVersion    |     ASCII |        5 |    148744 | 14.4
    148602 | 0xc741 OpcodeList2                  | UNDEFINED |      256 |    148750 | ...................D...........8 ...
    148614 | 0xc7aa                              |      LONG |        1 |           | 256
  END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
    149008 | 0x00fe NewSubfileType               |      LONG |        1 |           | 1
    149020 | 0x0100 ImageWidth                   |      LONG |        1 |           | 512
    149032 | 0x0101 ImageLength                  |      LONG |        1 |           | 288
    149044 | 0x0102 BitsPerSample                |     SHORT |        3 |    149216 | 8 8 8
    149056 | 0x0103 Compression                  |     SHORT |        1 |           | 34892
    149068 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 34892
    149080 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
    149092 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
    149104 | 0x0142 TileWidth                    |      LONG |        1 |           | 512
    149116 | 0x0143 TileLength                   |      LONG |        1 |           | 288
    149128 | 0x0144 TileOffsets                  |      LONG |        1 |           | 483404
    149140 | 0x0145 TileByteCounts               |      LONG |        1 |           | 22717
    149152 | 0xc61a BlackLevel                   |  RATIONAL |        3 |    149222 | 32/1 45/1 44/1
    149164 | 0xc716 PreviewApplicationName       |     ASCII |       20 |    149246 | Adobe DNG Converter
    149176 | 0xc717 PreviewApplicationVersion    |     ASCII |        5 |    149266 | 14.4
    149188 | 0xc741 OpcodeList2                  | UNDEFINED |      256 |    149272 | ...................D...........  ...
    149200 | 0xc7aa                              |      LONG |        1 |           | 256
  END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
    149530 | 0x00fe NewSubfileType               |      LONG |        1 |           | 1
    149542 | 0x0100 ImageWidth                   |      LONG |        1 |           | 256
    149554 | 0x0101 ImageLength                  |      LONG |        1 |           | 144
    149566 | 0x0102 BitsPerSample                |     SHORT |        3 |    149738 | 8 8 8
    149578 | 0x0103 Compression                  |     SHORT |        1 |           | 34892
    149590 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 34892
    149602 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 3
    149614 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
    149626 | 0x0142 TileWidth                    |      LONG |        1 |           | 256
    149638 | 0x0143 TileLength                   |      LONG |        1 |           | 144
    149650 | 0x0144 TileOffsets                  |      LONG |        1 |           | 506122
    149662 | 0x0145 TileByteCounts               |      LONG |        1 |           | 9462
    149674 | 0xc61a BlackLevel                   |  RATIONAL |        3 |    149744 | 51/1 21/1 16/1
    149686 | 0xc716 PreviewApplicationName       |     ASCII |       20 |    149768 | Adobe DNG Converter
    149698 | 0xc717 PreviewApplicationVersion    |     ASCII |        5 |    149788 | 14.4
    149710 | 0xc741 OpcodeList2                  | UNDEFINED |      256 |    149794 | ...................D............ ...
    149722 | 0xc7aa                              |      LONG |        1 |           | 256
  END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
     214 | 0x02bc XMLPacket                    |      BYTE |     6147 |       772 | <?xpacket begin="..." id="W5M0Mp ...
     226 | 0x8769 ExifTag                      |      LONG |        1 |           | 134348
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
    134350 | 0x829a ExposureTime                 |  RATIONAL |        1 |    134810 | 1/50
    134362 | 0x829d FNumber                      |  RATIONAL |        1 |    134818 | 1/1
    134374 | 0x8822 ExposureProgram              |     SHORT |        1 |           | 1
    134386 | 0x8827 ISOSpeedRatings              |     SHORT |        1 |           | 3200
    134398 | 0x8830 SensitivityType              |     SHORT |        1 |           | 2
    134410 | 0x8832 RecommendedExposureIndex     |      LONG |        1 |           | 3200
    134422 | 0x9000 ExifVersion                  | UNDEFINED |        4 |           | 0231
    134434 | 0x9003 DateTimeOriginal             |     ASCII |       20 |    134826 | 2024:02:29 19:10:08
    134446 | 0x9004 DateTimeDigitized            |     ASCII |       20 |    134846 | 2024:02:29 19:10:08
    134458 | 0x9010 OffsetTime                   |     ASCII |        7 |    134866 | -07:00
    134470 | 0x9011 OffsetTimeOriginal           |     ASCII |        7 |    134874 | -04:00
    134482 | 0x9012 OffsetTimeDigitized          |     ASCII |        7 |    134882 | -04:00
    134494 | 0x9201 ShutterSpeedValue            | SRATIONAL |        1 |    134890 | 5643856/1000000
    134506 | 0x9202 ApertureValue                |  RATIONAL |        1 |    134898 | 0/1
    134518 | 0x9203 BrightnessValue              | SRATIONAL |        1 |    134906 | 4294735111/65534
    134530 | 0x9204 ExposureBiasValue            | SRATIONAL |        1 |    134914 | 0/10
    134542 | 0x9205 MaxApertureValue             |  RATIONAL |        1 |    134922 | 0/65534
    134554 | 0x9206 SubjectDistance              |  RATIONAL |        1 |    134930 | 0/10
    134566 | 0x9207 MeteringMode                 |     SHORT |        1 |           | 5
    134578 | 0x9208 LightSource                  |     SHORT |        1 |           | 0
    134590 | 0x9209 Flash                        |     SHORT |        1 |           | 48
    134602 | 0xa001 ColorSpace                   |     SHORT |        1 |           | 1
    134614 | 0xa20e FocalPlaneXResolution        |  RATIONAL |        1 |    134938 | 136835/100
    134626 | 0xa20f FocalPlaneYResolution        |  RATIONAL |        1 |    134946 | 136835/100
    134638 | 0xa210 FocalPlaneResolutionUnit     |     SHORT |        1 |           | 2
    134650 | 0xa217 SensingMethod                |     SHORT |        1 |           | 2
    134662 | 0xa300 FileSource                   | UNDEFINED |        1 |           | .
    134674 | 0xa301 SceneType                    | UNDEFINED |        1 |           | .
    134686 | 0xa401 CustomRendered               |     SHORT |        1 |           | 0
    134698 | 0xa402 ExposureMode                 |     SHORT |        1 |           | 1
    134710 | 0xa403 WhiteBalance                 |     SHORT |        1 |           | 1
    134722 | 0xa404 DigitalZoomRatio             |  RATIONAL |        1 |    134954 | 10/10
    134734 | 0xa406 SceneCaptureType             |     SHORT |        1 |           | 0
    134746 | 0xa408 Contrast                     |     SHORT |        1 |           | 0
    134758 | 0xa409 Saturation                   |     SHORT |        1 |           | 0
    134770 | 0xa40a Sharpness                    |     SHORT |        1 |           | 0
    134782 | 0xa420 ImageUniqueID                |     ASCII |       33 |    134962 | 9141597707E8021D130A080002CD7D1E ...
    134794 | 0xa431 BodySerialNumber             |     ASCII |        9 |    134996 | 91415977
  END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng
     238 | 0xc612 DNGVersion                   |      BYTE |        4 |           | ...
     250 | 0xc613 DNGBackwardVersion           |      BYTE |        4 |           | ...
     262 | 0xc614 UniqueCameraModel            |     ASCII |        9 |      6920 | SIGMA fp
     274 | 0xc621 ColorMatrix1                 | SRATIONAL |        9 |      6930 | 13960/10000 4294959112/10000 958/10000 4294963694/10000 11625/10000 ...
     286 | 0xc622 ColorMatrix2                 | SRATIONAL |        9 |      7002 | 12431/10000 4294961755/10000 4294966296/10000 4294962909/10000 12361/10000 ...
     298 | 0xc627 AnalogBalance                |  RATIONAL |        3 |      7074 | 1000000/1000000 1000000/1000000 1000000/1000000
     310 | 0xc628 AsShotNeutral                |  RATIONAL |        3 |      7098 | 506931/1000000 1000000/1000000 598131/1000000
     322 | 0xc62a BaselineExposure             | SRATIONAL |        1 |      7122 | 100/100
     334 | 0xc62b BaselineNoise                |  RATIONAL |        1 |      7130 | 100/100
     346 | 0xc62c BaselineSharpness            |  RATIONAL |        1 |      7138 | 100/100
     358 | 0xc62e LinearResponseLimit          |  RATIONAL |        1 |      7146 | 100/100
     370 | 0xc62f CameraSerialNumber           |     ASCII |        9 |      7154 | 91415977
     382 | 0xc633 ShadowScale                  |  RATIONAL |        1 |      7164 | 1/1
     394 | 0xc634 DNGPrivateData               |      BYTE |     6734 |      7172 | SIGMA_EXTH_SPPA.z.............. ...
     406 | 0xc65a CalibrationIlluminant1       |     SHORT |        1 |           | 17
     418 | 0xc65b CalibrationIlluminant2       |     SHORT |        1 |           | 21
     430 | 0xc65d RawDataUniqueID              |      BYTE |       16 |     13906 | .AYw..........}.
     442 | 0xc6f4 ProfileCalibrationSignature  |     ASCII |       10 |     13922 | com.adobe
     454 | 0xc6f5 ExtraCameraProfiles          |      LONG |        1 |           | 150050
     466 | 0xc6f8 ProfileName                  |     ASCII |       15 |     13932 | Adobe Standard
     478 | 0xc6f9 ProfileHueSatMapDims         |      LONG |        3 |     13948 | 90 30 1
     490 | 0xc6fa ProfileHueSatMapData1        |     FLOAT |     8100 |     13960 |  ...
     502 | 0xc6fb ProfileHueSatMapData2        |     FLOAT |     8100 |     46360 |  ...
     514 | 0xc6fd ProfileEmbedPolicy           |      LONG |        1 |           | 0
     526 | 0xc6fe ProfileCopyright             |     ASCII |       35 |     78760 | Copyright 2019 Adobe Systems, In ...
     538 | 0xc714 ForwardMatrix1               | SRATIONAL |        9 |     78796 | 4348/10000 4303/10000 992/10000 1860/10000 7869/10000 ...
     550 | 0xc715 ForwardMatrix2               | SRATIONAL |        9 |     78868 | 4201/10000 4034/10000 1408/10000 2314/10000 7269/10000 ...
     562 | 0xc716 PreviewApplicationName       |     ASCII |       20 |     78940 | Adobe DNG Converter
     574 | 0xc717 PreviewApplicationVersion    |     ASCII |        5 |     78960 | 14.4
     586 | 0xc719 PreviewSettingsDigest        |      BYTE |       16 |     78966 | ..9}\J.....pA.ou
     598 | 0xc71a PreviewColorSpace            |      LONG |        1 |           | 2
     610 | 0xc71b PreviewDateTime              |     ASCII |       26 |     78982 | 2024-03-31T14:11:00-07:00
     622 | 0xc725 ProfileLookTableDims         |      LONG |        3 |     79008 | 36 8 16
     634 | 0xc726 ProfileLookTableData         |     FLOAT |    13824 |     79020 |  ...
     646 | 0xc761 NoiseProfile                 |    DOUBLE |        2 |    134316 | 
     658 | 0xc7a7 NewRawImageDigest            |      BYTE |       16 |    134332 | .v.......e.J....
END A002_652_20240229_000001_2k_10bit_adng_uncompressed.dng

dnglab structure

STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
 address |    tag                              |      type |    count |    offset | value
 4243478 | 0x00fe NewSubfileType               |     SHORT |        1 |           | 0
 4243490 | 0x0100 ImageWidth                   |      LONG |        1 |           | 1936
 4243502 | 0x0101 ImageLength                  |      LONG |        1 |           | 1090
 4243514 | 0x0102 BitsPerSample                |     SHORT |        1 |           | 16
 4243526 | 0x0103 Compression                  |     SHORT |        1 |           | 1
 4243538 | 0x0106 PhotometricInterpretation    |     SHORT |        1 |           | 32803
 4243550 | 0x010f Make                         |     ASCII |        6 |   4220968 | SIGMA
 4243562 | 0x0110 Model                        |     ASCII |        9 |   4220976 | SIGMA fp
 4243574 | 0x0111 StripOffsets                 |      LONG |        5 |   4220988 | 8 991240 1982472 2973704 3964936
 4243586 | 0x0112 Orientation                  |     SHORT |        1 |           | 1
 4243598 | 0x0115 SamplesPerPixel              |     SHORT |        1 |           | 1
 4243610 | 0x0116 RowsPerStrip                 |      LONG |        5 |   4221008 | 256 256 256 256 66
 4243622 | 0x0117 StripByteCounts              |      LONG |        5 |   4221028 | 991232 991232 991232 991232 255552
 4243634 | 0x011c PlanarConfiguration          |     SHORT |        1 |           | 1
 4243646 | 0x0131 Software                     |     ASCII |       17 |   4221048 | dnglab_lib 0.6.0
 4243658 | 0x0132 DateTime                     |     ASCII |       20 |   4221068 | 2024:03:31 14:17:45
 4243670 | 0x013b Artist                       |     ASCII |        1 |           | 
 4243682 | 0x0153 SampleFormat                 |     SHORT |        1 |           | 1
 4243694 | 0x828d CFARepeatPatternDim          |     SHORT |        2 |           | 2 2
 4243706 | 0x828e CFAPattern                   |      BYTE |        4 |           | ....
 4243718 | 0x8298 Copyright                    |     ASCII |        1 |           | 
 4243730 | 0x8769 ExifTag                      |      LONG |        1 |           | 4220636
  STRUCTURE OF TIFF FILE (II): A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
   address |    tag                              |      type |    count |    offset | value
   4220638 | 0x829a ExposureTime                 |  RATIONAL |        1 |   4220488 | 1/50
   4220650 | 0x829d FNumber                      |  RATIONAL |        1 |   4220496 | 0/10
   4220662 | 0x8822 ExposureProgram              |     SHORT |        1 |           | 1
   4220674 | 0x8827 ISOSpeedRatings              |     SHORT |        1 |           | 3200
   4220686 | 0x8830 SensitivityType              |     SHORT |        1 |           | 2
   4220698 | 0x8832 RecommendedExposureIndex     |      LONG |        1 |           | 3200
   4220710 | 0x9000 ExifVersion                  | UNDEFINED |        4 |           | 0220
   4220722 | 0x9003 DateTimeOriginal             |     ASCII |       20 |   4220504 | 2024:02:29 19:10:08
   4220734 | 0x9004 DateTimeDigitized            |     ASCII |       20 |   4220524 | 2024:02:29 19:10:08
   4220746 | 0x9010 OffsetTime                   |     ASCII |        7 |   4220544 | -04:00
   4220758 | 0x9011 OffsetTimeOriginal           |     ASCII |        7 |   4220552 | -04:00
   4220770 | 0x9012 OffsetTimeDigitized          |     ASCII |        7 |   4220560 | -04:00
   4220782 | 0x9201 ShutterSpeedValue            | SRATIONAL |        1 |   4220568 | 365946/65535
   4220794 | 0x9202 ApertureValue                |  RATIONAL |        1 |   4220576 | 0/65534
   4220806 | 0x9203 BrightnessValue              | SRATIONAL |        1 |   4220584 | 4294735111/65534
   4220818 | 0x9204 ExposureBiasValue            | SRATIONAL |        1 |   4220592 | 0/10
   4220830 | 0x9205 MaxApertureValue             |  RATIONAL |        1 |   4220600 | 0/65534
   4220842 | 0x9206 SubjectDistance              |  RATIONAL |        1 |   4220608 | 0/10
   4220854 | 0x9207 MeteringMode                 |     SHORT |        1 |           | 5
   4220866 | 0x9208 LightSource                  |     SHORT |        1 |           | 0
   4220878 | 0x9209 Flash                        |     SHORT |        1 |           | 48
   4220890 | 0x920a FocalLength                  |  RATIONAL |        1 |   4220616 | 0/10
   4220902 | 0xa001 ColorSpace                   |     SHORT |        1 |           | 1
   4220914 | 0xa402 ExposureMode                 |     SHORT |        1 |           | 1
   4220926 | 0xa403 WhiteBalance                 |     SHORT |        1 |           | 1
   4220938 | 0xa406 SceneCaptureType             |     SHORT |        1 |           | 0
   4220950 | 0xa431 BodySerialNumber             |     ASCII |        9 |   4220624 | 91415977
  END A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng
 4243742 | 0xc612 DNGVersion                   |      BYTE |        4 |           | ...
 4243754 | 0xc613 DNGBackwardVersion           |      BYTE |        4 |           | ...
 4243766 | 0xc614 UniqueCameraModel            |     ASCII |       15 |   4221088 | SIGMA SIGMA fp
 4243778 | 0xc616 CFAPlaneColor                |      BYTE |        3 |           | ...
 4243790 | 0xc617 CFALayout                    |     SHORT |        1 |           | 1
 4243802 | 0xc619 BlackLevelRepeatDim          |     SHORT |        2 |           | 2 2
 4243814 | 0xc61a BlackLevel                   |  RATIONAL |        4 |   4221104 | 65516/1024 65516/1024 65516/1024 65516/1024
 4243826 | 0xc61d WhiteLevel                   |     SHORT |        1 |           | 1023
 4243838 | 0xc61e DefaultScale                 |  RATIONAL |        2 |   4221136 | 1/1 1/1
 4243850 | 0xc61f DefaultCropOrigin            |     SHORT |        2 |           | 8 5
 4243862 | 0xc620 DefaultCropSize              |     SHORT |        2 |           | 1920 1080
 4243874 | 0xc621 ColorMatrix1                 | SRATIONAL |        9 |   4221152 | 14643/10000 4294959785/10000 4294962194/10000 4294963966/10000 11711/10000 ...
 4243886 | 0xc622 ColorMatrix2                 | SRATIONAL |        9 |   4221224 | 8252/10000 4294965252/10000 4294965552/10000 4294962335/10000 11648/10000 ...
 4243898 | 0xc628 AsShotNeutral                |  RATIONAL |        3 |   4221296 | 50693/100000 100000/100000 59813/100000
 4243910 | 0xc62a BaselineExposure             | SRATIONAL |        1 |   4221320 | 1024/1024
 4243922 | 0xc62b BaselineNoise                |  RATIONAL |        1 |   4221328 | 10/10
 4243934 | 0xc62c BaselineSharpness            |  RATIONAL |        1 |   4221336 | 10/10
 4243946 | 0xc62f CameraSerialNumber           |     ASCII |        9 |   4221344 | 91415977
 4243958 | 0xc634 DNGPrivateData               |      BYTE |     6734 |   4221356 | SIGMA_EXTH_SPPA.z.............. ...
 4243970 | 0xc635 MakerNoteSafety              |     SHORT |        1 |           | 0
 4243982 | 0xc65a CalibrationIlluminant1       |     SHORT |        1 |           | 17
 4243994 | 0xc65b CalibrationIlluminant2       |     SHORT |        1 |           | 21
 4244006 | 0xc65c BestQualityScale             |  RATIONAL |        1 |   4228092 | 1/1
 4244018 | 0xc68d ActiveArea                   |     SHORT |        4 |   4228100 | 0 0 1090 1936
 4244030 | 0xc6f9 ProfileHueSatMapDims         |      LONG |        3 |   4228108 | 36 2 1
 4244042 | 0xc6fa ProfileHueSatMapData1        |     FLOAT |      216 |   4228120 |  ...
 4244054 | 0xc6fb ProfileHueSatMapData2        |     FLOAT |      216 |   4228984 |  ...
 4244066 | 0xc6fc ProfileToneCurve             |     FLOAT |      256 |   4229848 |  ...
 4244078 | 0xc6fd ProfileEmbedPolicy           |      LONG |        1 |           | 1
 4244090 | 0xc74e OpcodeList3                  | UNDEFINED |    12564 |   4230872 | ........................?...... ...
 4244102 | 0xc761 NoiseProfile                 |    DOUBLE |        2 |   4243436 | 
 4244114 | 0xc763 TimeCodes                    |      BYTE |        8 |   4243452 | .'.....
 4244126 | 0xc764 FrameRate                    | SRATIONAL |        1 |   4243460 | 24000/1000
 4244138 | 0xc772 TStop                        |  RATIONAL |        1 |   4243468 | 0/10
END A002_652_20240229_000001_2k_10bit_dnglab_uncompressed.dng

@devonstanczyk
Copy link
Author

@cytrinox Yes, agreeing with @jedypod, this is HUGE for us Sigma FP shooters. This will save us soooo much disk space!

@cytrinox where can I find DNG specification documents?

@jedypod you mentioned earlier that you compared the RAW data between two DNG's. Can you start me down a path to learn how to do the same/how might I export a .txt of the RAW bayer data from a DNG?

If resolution is being reported incorrectly in Resolve, does that mean that the image has been reduced in resolution? Or is it just a metadata issue?

@jedypod
Copy link

jedypod commented Mar 31, 2024

@devonstanczyk You can use dcraw_emu from the LibRaw project to extract the raw bayer data without demosaick + whitebalance + calibration matrix. Here's a little bash script I use to dump out tiff images from raw files for this purpose if it helps:

#!/bin/bash

file_list=("$@")
for ((i = 0; i < ${#file_list[@]}; i++)); do
  filepath=$(realpath "${file_list[$i]}")
  filename=$(basename -- "$filepath")
  extension="${filename##*.}"
  filename="${filename%.*}"
  echo -e "Processing: \t${filepath}\n-->\t$(pwd)/${filename}.tif"
  dcraw_emu -o 0 -4 -T -W -r 1 1 1 1 -mem -disinterp -Z - "${filepath}" > "${filename}_mosaic.tif"
done

As for Resolve reporting the resolution wrong, it's purely metadata. The image is not being resized. It looks like 2048x1556 is some kind of fallback default.

That might be another thing to look at though @cytrinox : The resolution is being reported wrong in resolve for all dngs processed through dnglab. This is not happening with dngs processed through Adobe DNG converter. Maybe it's some issue in the metadata encoding?
screenshot_2024-03-31_16-39-53

@devonstanczyk
Copy link
Author

@jedypod thank you!

@jedypod I am getting correct resolution and bit depth being reported in DaVinci Resolve. Are you sure you didn't import old DNG's from previous DNGlab build?

@devonstanczyk
Copy link
Author

Also testing again, I'm getting same issue described above when loading DNGlab DNG's into Adobe Photoshop/Camera RAW: No RAW color profiles are available for DNG's processed with DNGlab. If DNGlab is retaining the bayer data, why does Adobe not recognize this? DNGlab is not creating demosaiced/linear DNG's correct?
Screenshot 2024-03-31 at 6 24 37 PM
Screenshot 2024-03-31 at 6 24 41 PM
Screenshot 2024-03-31 at 6 24 59 PM
Screenshot 2024-03-31 at 6 25 03 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants