Can DNG files be analyzed in Fiji?

Hello,

I have DNG format images that I would like to analyze in Fiji. I have used the BioFormats plugin and can open the files, but I’m worried that it is only opening the JPEG preview that is packaged in the DNG file and not the “raw” image component of the DNG that I am wanting to use.

Is it possible to import and analyze DNG files in Fiji?

Thanks!

Hi @MSowers, the DNG files should be able to be read through Bio-Formats (Canon DNG — Bio-Formats 6.6.0 documentation). If you select to display the OME-XML and the metadata when opening the file does the metadata and dimensions look to be correct?

Hi David,

Thanks for the quick response! I looked at the link you sent and saw that the extension for the Canon DNG is .cr2 and .crw.

I’m using an Adobe DNG where the extension is .dng.

The Metadata that I get from the DNG seems to look similar to what I get from a JPEG of the same image.

Ok, that will be a different format from the Canon DNG. I was able to get some .dng files to test with and Bio-Formats treats them similar to Tiff files so should be able to read them correctly. From what I can tell it is reading the original image and metadata as expected. It looks as though a Lossless JPEG compression is being used and this does appear to be correct (the file size would suggest that it is indeed compressed).

Hi David,

Thank you for testing with some .dng files!

So, if I am understanding correctly:

  • If I open my .dng images with Bio-Formats I am opening and processing the original images.

  • The images that I am working with are displayed as 4032x3024, 8-bit, 35MB (not the 302x44032,16-bit, 70MB as a .tif file would show up as). This is because they undergo a Lossless JPEG compression.

I know that JPEG compression that is lossy creates artifacts and discards some of the pixel data. With my images, I have less bit depth than I would have if analyzing a .tif image, but since the JPEG compression that is shown in the .dng file is lossless, is it correct to assume that I am not losing any more pixel data/image information and should be able to generate data that is being losslessly compressed in the same way each time?

Thank you again for your help! I have a very rudimentary understanding of the level of image quality needed for reliable analysis, so I’m trying to learn exactly what is happening to the images from capture to analysis.

Bio-Formats is certainly opening the original image from the file. Trying to determined if the compression is truly lossless or not is trickier. From what I can tell the files look lossless but they are however being decompressed as JPEG rather than Lossless JPEG so it may be that that there has been lossy compression. It would be worth checking with the acquisition software to confirm what level of compression is being used and if it is truly Lossless. There doesn’t appear to be any metadata which would easily identify the level used.

Hi David,

I looked into Adobe’s DNG Specifications and saw this section on compression.

With the images that I’m using, the PhotometricInterpretation is YCbCr but the BitsPerSample is 8. So this would be a lossless Huffman JPEG variant?

Based on that it then it looks like the lossless compression.

Thanks for your help, David! This has cleared some things up.