Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: AFairley on August 15, 2016, 01:23:50 pm

Title: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: AFairley on August 15, 2016, 01:23:50 pm
My general understanding is that each pixel in a JPEG, say, image contains data for each of the R, G & B channels and that this per-pixel data is assembled/converted from what essentially is luminance-only data from each color-filtered sensel (grouped by 4s) that Is what the raw file contains; and that this assembly/conversion  process commonly is called "demosiacing."  Am I right so far (as to the general concept)?

If so, has a DNG created from a raw file by Adobe DNG converter or Lightroom been demosaiced, or does it still contain the original sensel data?  In other words, is a DNG truly raw?

Thanks.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: ErikKaffehr on August 15, 2016, 01:36:21 pm
Hi,

In general a DNG file is not demosaiced, but it is possible to contain demosaiced data in a DNG container.

DNG is just like an envelope. It can contain a love letter or a bomb…, but mostly they are about bills to pay…

Best regards
Erik




My general understanding is that each pixel in a JPEG, say, image contains data for each of the R, G & B channels and that this per-pixel data is assembled/converted from what essentially is luminance-only data from each color-filtered sensel (grouped by 4s) that Is what the raw file contains; and that this assembly/conversion  process commonly is called "demosiacing."  Am I right so far (as to the general concept)?

If so, has a DNG created from a raw file by Adobe DNG converter or Lightroom been demosaiced, or does it still contain the original sensel data?  In other words, is a DNG truly raw?

Thanks.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: Alan Smallbone on August 15, 2016, 01:51:42 pm
I believe that in some forms it is demosaiced. For instance, take a Fuji XT-1 raw file, if you convert to DNG and set the spec right you can open it up as a Adobe RAW image in earlier versions in which ACR does not have the pipeline for that sensor. So it is demosaiced and then put into an Adobe raw format that can still have the color balance modified etc.

Alan
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: digitaldog on August 15, 2016, 02:04:07 pm
If so, has a DNG created from a raw file by Adobe DNG converter or Lightroom been demosaiced, or does it still contain the original sensel data?  In other words, is a DNG truly raw?
No, it may not be truly raw. You can save a JPEG inside a DNG. It's just a container. That's still a JPEG. Nothing to do with raw despite the name of the container. You can save a lossy DNG.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: AFairley on August 15, 2016, 03:48:28 pm
Andrew, understood that DNG is a container, and obviously a JPEG put into that container is still a JPEG datawise. But I am talking about the case of an NEF or ORF or CR2 converted with the Adobe converter. In that case has the original raw been demosaiced in the conversion?
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: digitaldog on August 15, 2016, 03:51:22 pm
Depends on what is done to the data before it's placed into the DNG. Again, Lossy DNG is another example.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: fdisilvestro on August 15, 2016, 04:12:55 pm
When using the Adobe DNG converter, the default is no demosaicing for most raw types, at least for those with standard CFA. You can choose "Linear DNG" (shown in the attached image) in the custom option and that will demosaice the file but it will still be luminance data, not color encoded yet. Some refer to this as a "half baked file", where you still need a program like LR or ACR to generate a full processed image.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: Guillermo Luijk on August 15, 2016, 05:09:24 pm
I've begun to use the Adobe DNG Converter only recently, as a result of DCRAW not supporting properly uncompressed RAW files from my Sony A7 II. I can say it not only doesn't demosaice the original data, but it even doesn't modify the black offset nor scales to a more convenient bitscale. In other words, it stores exactly the same RAW numbers as in the source file.

Add to this that the lossless compressed resulting DNG is half the size of the original ARW uncompressed file, and processing an entire folder is an easy and quick task, and I couldn't be happier with the conversion.

I also have a feeling that the saturation points embedded as metadata in the output DNG file could be more accurate than those hard coded values from David Coffin, which occasionally are not 100% correct (a wrong saturation point will either clip valid highlights information, or in the worst case will produce a magenta cast over clipped highlights).

Regards
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: sandymc on August 16, 2016, 10:50:34 am
Generally, there are only two situations in which DNG Converter would demosaic a file:

Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: digitaldog on August 16, 2016, 10:57:23 am
Generally, there are only two situations in which DNG Converter would demosaic a file:
And there's this (a way to bake a JPEG into a DNG):

Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: sniper on August 17, 2016, 12:30:56 pm
And there's this (a way to bake a JPEG into a DNG):
Whats this from Andrew.  Photoshop or something else?
Regards Wayne
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: digitaldog on August 17, 2016, 12:42:52 pm
Whats this from Andrew.  Photoshop or something else?
Regards Wayne
Lightroom
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: Tim Lookingbill on August 17, 2016, 03:01:07 pm
Andrew, just for clarity are you saying that exporting out of Lightroom choosing DNG format will demosaic the Raw data and present the preview in the form of a jpeg that's baked in the DNG?

I wonder if those who choose to export to DNG in Lightroom know that they aren't using the traditional stand alone DNG converter but Lightroom's implementation that demosaics the Raw data.


If I'm misunderstanding from what I've just said because now I'm not even sure, please correct me.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: fdisilvestro on August 17, 2016, 03:11:41 pm
I am also confused by Andrew's post. If you chose DNG then you have the option to select "Use Lossy compression" or not but this option appears only after you chose DNG. If you don't check the "Use Lossy Compression" then the image is not demosaiced (if your original is an undemosaiced RAW, of course)
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: john beardsworth on August 17, 2016, 03:14:12 pm
I wonder if those who choose to export to DNG in Lightroom know that they aren't using the traditional stand alone DNG converter but Lightroom's implementation that demosaics the Raw data.
If I'm misunderstanding from what I've just said because now I'm not even sure, please correct me.

Yes, you are misunderstanding, Tim. Usually, Lightroom DNGs are a wrapper around raw data, but for certain purposes one may want to use DNG to wrap demosaiced data. What Andrew is showing is Lightroom provides export options to save demosaiced data inside DNGs - but they are only options.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: sniper on August 17, 2016, 03:26:22 pm
Lightroom
Ahhh, thank you.
Regards Wayne
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: fdisilvestro on August 17, 2016, 03:36:33 pm
Yes, you are misunderstanding, Tim. Usually, Lightroom DNGs are a wrapper around raw data, but for certain purposes one may want to use DNG to wrap demosaiced data. What Andrew is showing is Lightroom provides export options to save demosaiced data inside DNGs - but they are only options.

Andrew is showing the export dialoge with the option to select the output formal, where the previous choice was jpg. There is no indication that the original file is a jpeg or raw. I think Tim question is a valid one as Andrew's post is not clear enough
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: Tim Lookingbill on August 17, 2016, 04:20:03 pm
Yes, you are misunderstanding, Tim. Usually, Lightroom DNGs are a wrapper around raw data, but for certain purposes one may want to use DNG to wrap demosaiced data. What Andrew is showing is Lightroom provides export options to save demosaiced data inside DNGs - but they are only options.

Demosaiced data means the Raw data is still contained in the DNG wrapper but it's now in a demosaiced stage and not the original untouched Raw data, right? The preview from this DNG wrapper whether the data is demosaiced or not does not change because it's a fixed embedded jpeg preview, right?

Is there a way to distinguish a DNG has demosaiced data from one that has the original untouched Raw data after export from LR? What would be the indicator?
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: Tim Lookingbill on August 17, 2016, 04:37:05 pm
I guess I'll just come out and say it.

Has anyone in the past ten years benefited from keeping up with this level of complexity? I want to see proof!

I've gone through three re-edits of the same Raw PEF files starting with PV2003, then PV2010 and now PV2012 and I can't see any significant advances or benefits provided by the complexity of saving or exporting to DNG with all the options I have to keep in my head.

All those PV version edits I felt I was working on a 16 bit jpeg preview without compression artifacts at 100% zoom view where the sliders seem to appear to be more graceful and refined than working on incamera jpegs in editing highlights and shadows with a different color palette than the incamera jpeg.

So what's with all the complexity and options with DNG? I've got another re-edit to do! SHEESH!
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: john beardsworth on August 17, 2016, 05:30:38 pm
Demosaiced data means the Raw data is still contained in the DNG wrapper but it's now in a demosaiced stage and not the original untouched Raw data, right? The preview from this DNG wrapper whether the data is demosaiced or not does not change because it's a fixed embedded jpeg preview, right?

Is there a way to distinguish a DNG has demosaiced data from one that has the original untouched Raw data after export from LR? What would be the indicator?
No, the raw data in the DNG remains raw data, ie before demosaicing. The preview is a JPEG, so by definition demosaiced.

In Lightroom's Metadata panel there is a DNG view.
Title: Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
Post by: digitaldog on August 17, 2016, 06:49:05 pm
Andrew, just for clarity are you saying that exporting out of Lightroom choosing DNG format will demosaic the Raw data and present the preview in the form of a jpeg that's baked in the DNG?
I'm just saying DNG is a container and you can bake lots of data into it. In this case a JPEG. That doesn't make the JPEG any less a JPEG.