4 Replies Latest reply on Feb 19, 2018 1:35 PM by trendyme0987642

    DNG Converter Issue with Nikon D810

    trendyme0987642

      I found an issue with how DNG converter converts Nikon D810 NEF files. NEF image size is 7380x4928 and doesn't have any masked pixels. The final size of the image after processing is 7360x4912, which means that there is a padding of 10 pixels on top and bottom and 8 pixels on left and right of the image. However, the image in the DNG has a size of 7372x4920. That should not happen, since there are no masked pixels in the NEF file. Moreover, DNG says that the crop origin is at 12x8. That leaves zero padding at the right and bottom of the image for CFA interpolation. This is confirmed by the dng_validate.exe tool in the DNG SDK, which outputs this:

       

      *** Warning: Too little padding on right edge of CFA image (possible interpolation artifacts) ***

      *** Warning: Too little padding on bottom edge of CFA image (possible interpolation artifacts) ***

       

      I am using the latest DNG converter (10.2.0.894). Has anybody else noticed this? Any chances this is going to get fixed soon? Not a huge issue, but this should be really easy to fix. I don't want to use Nikon's CaptuerNX, I never have.

        • 1. Re: DNG Converter Issue with Nikon D810
          JimHess Adobe Community Professional & MVP

          I don't have the Nikon D810. I downloaded a sample raw image (NEF file) and converted it with the DNG converter. The converted DNG file measured 7360 x 4912 pixels, which is the published dimensions of the large image size for the camera. I am not a highly technical person so I don't understand or care to understand where you came by those other higher numbers. But according to Nikon's published specifications and my conversion of the NEF file that I downloaded, everything seems to be in order.

          • 2. Re: DNG Converter Issue with Nikon D810
            trendyme0987642 Level 1

            Hi Jim,

             

            Thank you for your reply. I appreciate your looking into this. I will explain in more detail how I arrived to my conclusions, for people who care to understand, at the risk of making this post a bit too large.

             

            But before I do that, let me give a little technical background. Most RAW images use a CFA pattern; this means that each pixel captures only one color (R, G, or B). In order for such an image to be converted to a full RGB image, interpolation has to be performed at pixel level for colors that are missing at that pixel. For example, both R and B have to be interpolated for a pixel in the CFA image that captures only G, and both R and G have to be interpolated for a pixel that captures only B, and so on. Interpolation uses values of neighboring pixels that capture the same color. Digital cameras capture images slightly larger than the final image, so that there are enough neighboring pixels at the edge of the final image to use for interpolation and avoid artifacts.

             

            Now back to the numbers. NEF files are TIFF files, which means you can use TIFF readers to peek into them. This is an excerpt from ExifTool output when run on a D810 NEF file:

             

            ...

            Image Width                     : 7380

            Image Height                    : 4928

            Bits Per Sample                 : 14

            Compression                     : Uncompressed

            Photometric Interpretation      : Color Filter Array

            ...

             

            This shows that the size of the original RAW image is 7380x4928. Since interpolators need to produce a final image of 7360x4912, they have 10 extra pixels at top and bottom and 8 extra pixels at left and right of the image to use for interpolation. I would expect the DNG file to retain all the pixels of the original NEF (since DNG processors need to perform this interpolation), but running ExifTool on the DNG file gives this:

             

            ...

            Image Width                     : 7372

            Image Height                    : 4920

            Bits Per Sample                 : 16

            ...

             

            As you can see, the DNG keeps only 7372x4920 of the original image, for no good reason. Granted, it still keeps more than the final image size of 7360x4912, so the interpolator should still have, in theory, 6 extra pixels at top and bottom and 4 extra pixels at left and right. However, according to ExifTool, the DNG file also contains this:

             

             

            Default Crop Origin             : 12 8

            Default Crop Size               : 7360 4912

             

            What this means is that the interpolator is supposed to trim 12 pixels on the left and 8 pixels at the top from the final image (instead of 6 and 4, respectively). This leaves no extra pixels at the right and bottom of the image for interpolation, which is confirmed by dng_validate tool that comes with the DNG SDK:

             

            *** Warning: Too little padding on right edge of CFA image (possible interpolation artifacts) ***

            *** Warning: Too little padding on bottom edge of CFA image (possible interpolation artifacts) ***

             

            I've done this analysis on my D700 DNG files and they appear to be handled correctly by the DNG converter.

             

            I hope this sheds more light on the issue. Admittedly, the interpolation artifacts at the edge of the image should be of little consequence, but this depends on how you plan to use your images. Also, this should be an easy fix, and I see no real reason not to do the right thing and please pixel peepers like me.

            • 3. Re: DNG Converter Issue with Nikon D810
              JimHess Adobe Community Professional & MVP

              Since this is only a user to user forum, I doubt you'll get much resolution to the "problem" here. I suggest that you express your concerns on the following forum which is monitored more closely by the developers. You might get more consideration of your concerns and a more meaningful response there.

              Photoshop Family Customer Community

              • 4. Re: DNG Converter Issue with Nikon D810
                trendyme0987642 Level 1

                Thanks Jim! I've posted this issue there.