Pages: [1] 2   Go Down

Author Topic: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?  (Read 8116 times)

AFairley

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1486

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.
Logged

ErikKaffehr

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 11311
    • Echophoto
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #1 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.
Logged
Erik Kaffehr
 

Alan Smallbone

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 788
    • APS Photography
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #2 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
Logged
Alan Smallbone
Orange County, CA

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20649
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #3 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.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

AFairley

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1486
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #4 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?
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20649
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #5 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.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1854
    • Frank Disilvestro
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #6 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.

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #7 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
« Last Edit: August 16, 2016, 06:14:08 pm by Guillermo Luijk »
Logged

sandymc

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 350
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #8 on: August 16, 2016, 10:50:34 am »

Generally, there are only two situations in which DNG Converter would demosaic a file:

  • If you specifically tell it to by setting the "Linear Raw" or "Lossy" modes as discussed in previous posts
  • If the current DNG specification (or the DNG specification that you have selected for the conversion via the compatibility setting) doesn't adequately support something in the raw file, DNG Converter will automatically "fall back" to Linear Raw mode. This has occasionally been the case in the past e.g., when X-Trans images first came out, and for some raw formats with built-in lens correction. As far as I am aware, the current version of DNG converter, used with the latest "Compatibility" settings, will never have to "fall back" for any currently available camera.
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20649
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #9 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):

Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

sniper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 670
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #10 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
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20649
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #11 on: August 17, 2016, 12:42:52 pm »

Whats this from Andrew.  Photoshop or something else?
Regards Wayne
Lightroom
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #12 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.
Logged

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1854
    • Frank Disilvestro
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #13 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)

john beardsworth

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 4755
    • My photography site
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #14 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.
Logged

sniper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 670
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #15 on: August 17, 2016, 03:26:22 pm »

Lightroom
Ahhh, thank you.
Regards Wayne
Logged

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1854
    • Frank Disilvestro
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #16 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

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #17 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?
« Last Edit: August 17, 2016, 04:23:48 pm by Tim Lookingbill »
Logged

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #18 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!
Logged

john beardsworth

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 4755
    • My photography site
Re: Does DNG conversion from a raw file (e.g., ORF, NEF) demosaic the raw?
« Reply #19 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.
Logged
Pages: [1] 2   Go Up