16 Replies Latest reply on Nov 29, 2008 5:30 AM by Bill_Janes

    Digital gain tag in DNG files?

      Is there a specific tag in DNG files that specifies the digital gain that should be applied by ACR? Is it BaselineExposure, another tag, or none of the above?

      Thanks,

      Jeff
        • 1. Re: Digital gain tag in DNG files?
          Thomas Knoll Level 2
          Yes it is baseline exposure (and/or the white level tag).
          • 2. Re: Digital gain tag in DNG files?
            Level 1
            Thanks for your reply.

            For Panasonic LX3 DNG files, I get a strange white level number - 65535 - for each of the 3 channels. Given the special treatment of LX3 files, is this a meaningful number? If so, how should it be interpreted compared to a more typical white level value, e.g., 4095?
            • 3. Re: Digital gain tag in DNG files?
              MadManChan2000 Adobe Employee
              Jeff, that is because those DNG files are Linear DNG, in which the data has already been mapped to a nominal [0,1] space and encoding using 16 bits. Hence white is the maximum representable 16-bit unsigned integer, which is 65535 (and black of course is encoded as zero).
              • 4. Re: Digital gain tag in DNG files?
                Level 1
                Eric, thanks for your response.

                I am trying to figure out if any digital gain is being applied to LX3 files during raw development. The value -0.25 for BaselineExposure in each of the files I examined implies no digital gain, but I do not understand the implication of the white level values. (I assume that the actual white level values would have to be viewed in the original rw2 files.)

                Jeff
                • 5. Re: Digital gain tag in DNG files?
                  Thomas Knoll Level 2
                  >I am trying to figure out if any digital gain is being applied to LX3 files during raw development.

                  Why do you care?
                  • 6. Re: Digital gain tag in DNG files?
                    Level 1
                    The sensor ISO Sensitivity results published by DxO Labs for the LX3 are about one stop lower than what people are experiencing in the field. I have been trying to figure out if they are correct. If no digital gain is being applied to LX3 raws, I'd expect the DxO results to approximate field results.

                    This is something that I am pursuing out of intellectual curiosity and as a vehicle to understand more about raw processing. I realize that you folks are pretty busy, so I'll understand if you don't spend more time on this.

                    Jeff
                    • 7. Re: Digital gain tag in DNG files?
                      Thomas Knoll Level 2
                      No unusual gain is applied during raw conversion for the LX3.
                      • 9. Re: Digital gain tag in DNG files?
                        MadManChan2000 Adobe Employee
                        Jeff, there are 2 things to consider with regards to ISO and metering.

                        DxO labs's ISO calibration has to do with the raw level produced by the sensor when provided a specific, known level of illumination (they are using a saturation-based method loosely based on ISO 12232). For example, if the illuminance at the focal plane is 100 lux, and you expose on the LX3 at manual mode with f/5.6, ISO 100, 1/100 second, what is the raw level and how does that relate to the white level?

                        This is completely separate from metering, which is most likely what users are reporting from the field (e.g., using aperture priority, or using manual with the meter as a guide to figure out where to place highlights).

                        For instance, it is perfectly conceivable for the LX3 to have "perfect ISO calibration" but have a meter that deliberately underexposes, or the other way around.
                        • 10. Re: Digital gain tag in DNG files?
                          Bill_Janes Level 2
                          Jeff Charles wrote:
                          > I am trying to figure out if any digital gain is being applied to LX3 files during raw development.

                          Thomas Knoll wrote:
                          >Why do you care?

                          Jeff, you can convert your raw file to a DNG and read the BaseLine exposure with an exif editor. For example, with my Nikon D3 the baseline offset is +0.5 EV. If one exposes to the right such that the highlights are just short of clipping, they will appear clipped in the ACR preview using an exposure value of 0; if you use a value of -0.5, you will get a more accurate preview.

                          Thomas, this is why it is useful to know the BaseLine offset. Nikon apparently leaves 0.5 stop of headroom, but practitioners of exposure to the right may want to use less headroom.
                          • 11. Re: Digital gain tag in DNG files?
                            Level 1
                            Bill - Thomas had previously pointed me to the dng_validate utility. When I checked LX3 files with the utility, they all showed a BaselineExposure of -0.25.
                            • 12. Re: Digital gain tag in DNG files?
                              Bill_Janes Level 2
                              >DxO labs's ISO calibration has to do with the raw level produced by the sensor when provided a specific, known level of illumination (they are using a saturation-based method loosely based on ISO 12232).

                              Eric,

                              The ISO 12232:2006 standard is very confusing, at least in the linked Wikipedia article. I don't know how accurate the article is, and I don't care to pay to get the official ISO document. I'm sure that you are familiar with this document but will quote from certain portions of the Wikipedia article for the convenience of those not familiar with the new standards.

                              The Recommended Exposure Index (REI) technique, new in the 2006 version of the standard, allows the manufacturer to specify a camera models Exposure Index choices arbitrarily. In the new version, REI is the only technique available for output formats that are not in the sRGB color space.

                              The Standard Output Specification (SOS) technique effectively specifies that the average level in the sRGB image must be 18% gray plus or minus 1/3 stop when exposed per the EI with no exposure compensation. Because the output level is measured in the sRGB output from the camera, it is only applicable to sRGB imagestypically JPEGand not to output files in raw image format.

                              According to the CIPA DC-004 published in 2006, Japanese manufacturers of digital still cameras are required to specify whether a sensitivity rating is REI or SOS. Thus, for raw files REI is the only option available for Japanese cameras using raw files and the chosen ISO is arbitrary.

                              Bill Claff has published the effective ISOs for various Nikon cameras, and it is interesting to note that their calibration values have changed in recent years and they use a "hotter" ISO than previously. For a nominal ISO of 100 with the D70, Bill got an effective ISO of 202 and for the more recent D3 and D300, he got values of 133 and 140 respectively with the camera set to ISO 200 and using a bit depth of 12.

                              I exposed a gray card with my D3 set to ISO 200, using the indicated exposure and a bit depth of 12. In ACR using aRGB and the default tone curve and 8 bits, the resulting gray value is 159, well above the nominal value for mid-gray of 117. Compensating for the baseline offset of +0.5 by using an exposure value of -0.5 gives a value of 134.

                              The average raw value in the green channels as determined by Rawnalize gave a 12 bit pixel value of 455 or 455/4095 = 11.1% saturation, very close to the12% value that should result from exposure according to a reading from a standard light meter, which is calibrated for 12% reflectance ( Thom Hogan).

                              In summary, the D3 with ACR conversion at the default settings allow 0.5EV of headroom for highlights. Practitioners of exposure to right (ETTR) might want to change their ACR default exposure to -0.5. Users of Canon and other cameras might want to perform a similar calibration for their own camera.

                              I understand that the BaseLine exposure value used by ACR compensates for the differences in highlight headroom allowed by different cameras so that the results with ACR are similar with different cameras.

                              Your comments are most welcome.
                              • 13. Re: Digital gain tag in DNG files?
                                MadManChan2000 Adobe Employee
                                Bill, that's correct, the chosen ISO is essentially arbitrary for the raw files (also may depend on whether you choose "evaluative" or "matrix metering" vs. spot metering). I have also not found any documentation from Nikon, Canon, etc. on which illuminant they use, though I'm assuming it's D55. (You'll get quite a different result if using D55 versus Illuminant A, for instance.)

                                Bill Claff's data, I believe, is based on how the camera meters, i.e., the correlation between what the meter indicates and what raw levels get recorded. At least, that's my impression reading his "ISO Collaboration" page. And yes, this is fine (and useful) for determining metering discrepancies between models (e.g., D3 and D200), or even between two units of the same model (e.g., your D3 and my D3).

                                However, as I indicated above, that is a separate & independent topic from the concept of ISO sensitivity, which (for raw files) is about what raw level is generated for a given exposure, which is measured in lux-seconds.

                                For example, consider a Nikon D70 and a Nikon D300. Let's pretend for the moment that they don't even have meters. But we can still compare them in terms of ISO sensitivity:

                                A. Shoot a scene with the D70, f/8, ISO 200, 1/30 second.
                                B. Shoot the exact same scene with the D300, with identical settings (f/8, ISO 200, 1/30 second, same lens, etc.)

                                Observe that for experiments A and B, the same scene was photographed with both cameras, so the sensors received the same exposure (i.e., illuminance integrated over the exposure time, which was 1/30 second).

                                But do the two cameras generate the same raw levels relative to their saturation points? If they did, then one could argue that they have the same ISO rating using the ISO 12232 saturation-based criterion.

                                But in general, they don't, because of (for instance) different choices made by the camera maker with regards to the amplifier.

                                (Now, bringing metering back into the discussion, the two cameras could still behave similarly in terms of metering, even though the ISO ratings are different.)
                                • 14. Re: Digital gain tag in DNG files?
                                  Level 1
                                  >Observe that for experiments A and B, the same scene was photographed with both cameras, so the sensors received the same exposure

                                  Given the potential variation one might experience in the actual light hitting the sensor due to fluctuations in shutter speed (likely) or F stop (unlikely). This is where all this stuff while technically interesting may not be really germane to actual users. Ideally, users can take steps to characterize their "system" of camera unit, ISO, Shutter seeds and meter to arrive at optimal ISO settings relative to the A>D converter and their sensor but I find it's often easier just to bracket :~)

                                  What is useful is to know what your sensor's effective dynamic range is at various ISO settings so you can better expose for a scene's dynamic range. Notice I said "effective" not absolute as that's just another rabbit hole to go down...
                                  • 15. Re: Digital gain tag in DNG files?
                                    Panoholic Level 2
                                    > Observe that for experiments A and B, the same scene was photographed with both cameras, so the sensors received the same exposure (i.e., illuminance integrated over the exposure time, which was 1/30 second).

                                    > But do the two cameras generate the same raw levels relative to their saturation points? If they did, then one could argue that they have the same ISO rating using the ISO 12232 saturation-based criterion.

                                    > But in general, they don't, because of (for instance) different choices made by the camera maker with regards to the amplifier

                                    Is the BaselineExposure generated by ACR respectively the DNG converter meant to compensate for such differences?
                                    • 16. Re: Digital gain tag in DNG files?
                                      Bill_Janes Level 2
                                      >Bill Claff's data, I believe, is based on how the camera meters, i.e., the correlation between what the meter indicates and what raw levels get recorded.

                                      That is correct. I participated in Bill's ISO collaboration and the camera light meter is used to determine exposure and there was no check on the calibration of the individual light meters. As you correctly point out, two factors are involved: the calibration of the light meter (which determines the shutter speed and f/stop) and the response of the camera to the exposure thus determined.

                                      However, I think that Bill's data are reasonably accurate, since, as the Nikon guru Thom Hogan reports, Nikon metering is usually spot on and any random variation between individual cameras would be evened out by taking a mean of the results. Checking the calibration of the camera light meter would require comparison of the exposure indicated by the camera light meter with the exposure indicated by a calibrated light meter.

                                      I think that the differences among the various Nikon camera models are mainly due how the camera handles a given exposure in lux-seconds. The ISO sensitivity of the sensor, the highlight headroom and the tone curve (if one is dealing with rendered files) are the main factors here.
                                      >However, as I indicated above, that is a separate & independent topic from the concept of ISO sensitivity, which (for raw files) is about what raw level is generated for a given exposure, which is measured in lux-seconds.

                                      Quite true. This is where the DXO ISO results are particularly helpful. The Wikipedia article gives the equations for determining the sensor ISO from a given exposure in lux-seconds. However, most of us do not have a calibrated light meter and the light transmission of the lens is generally unknown. For practical purposes it is generally sufficient to measure the overall system response by comparing the percent saturation in the raw file to the exposure indicated by the light meter.