5 Replies Latest reply on Mar 5, 2009 6:07 PM by MadManChan2000

    Question DNG and compressed DNG Version 1.0 of DNG standard

    fware_de
      Hi,

      on my digital back I can save the files als DNG = 64 MB per shot, or compressed DNG = 32 MB per shot.

      Based on dng_validate and RawnalyzeTL there is no compression used.
      As writen, if dng_validate re-writes the file it is 11 MB smaler and NOW there is a compression information set.

      Can some one explain to me what kind of compression is used for my compressed DNG's ? Is there a loss if compressed is used ? (As I see no differences)

      Thanks
      Peter
        • 1. Re: Question DNG and compressed DNG Version 1.0 of DNG standard
          Panoholic Level 2
          Peter,

          the larger DNG file you mentioned in the other thread containes 8 bits per pixel, uncompressed. If this is what you refer to above with "compressed DNG", then you misunderstood the meaning of "compressed" (perhaps the user's guide is not clear?).

          That format is *lossy*. True, it is smaller than the lossless version, but still, calling it "compression" is euphemism.

          If this is so, then the 64MB version must be lossless, uncompressed. If you send me the taglist file, I take a look at it.

          Note, that the "compression" in the 32 MB file is rather "mutilation". Only 256 levels of pixel intensity are maintained; this can cause posterization/banding. I am surprized to see, that a high-end camera supports such format at all (although if the Leica M8 can afford this...).

          Back to your question: the compression method adopted in DNG is lossless (there could be exceptions, but I have not seen any yet). The lossy data can be compressed or uncompressed; your two files are the examples. However, the *compression itself* does not cause any loss.
          • 2. Re: Question DNG and compressed DNG Version 1.0 of DNG standard
            sandy_mc Level 3
            Just to amplify, in a DNG, data can be compressed by two entirely different ways:

            1. Level compression, via some form of a gamma curve. This is indeed what the Leica M8 does. But note, as far as I am aware, this is only ever done by the source device (the camera or whatever). I don't know of any way to get ACR or DNG converter to this to previously un-level compressed data.

            2. "Mathematical" data compression, via an LZW type algorithm. This is entirely lossless, and is similar to a zip file. DNG converter will do this to previously uncompressed files.

            Note its possible to get either, neither or both forms of compression in one file. So, e.g., a Leica M8 file, completely uncompressed is about 20MB, level compressed about 10MB, and both level and LZW compressed, about 6MB.
            • 3. Re: Question DNG and compressed DNG Version 1.0 of DNG standard
              Panoholic Level 2
              > 1. Level compression, via some form of a gamma curve

              This is not a compression, neither in fact nor in DNG terminology. I would say "weeding" or "mutilation" are better names. Anyway, this way of reducing the storage requirement can be deployed with or without compression.

              > 2. "Mathematical" data compression, via an LZW type algorithm

              The DNG specification does not support this. The accepted compressions are JPEG baseline (lossy) and JPEG lossless.

              Another form of compression is putting the raw data bits tightly together, if the bit depth is not a multiple of 8 (packing). This is the *required* form in DNG if no other compression is deployed; it is coded as "uncompressed".
              • 4. Re: Question DNG and compressed DNG Version 1.0 of DNG standard
                sandy_mc Level 3
                Ack, sorry, Huffman encoding, not LZW. Need to apply brain before hitting keyboard. As to whether level compression is compression or mutilation, well, that's a religious argument. But certainly its common terminology in the industry - e.g., Nikon's "compressed NEFs" are level compressed.
                • 5. Re: Question DNG and compressed DNG Version 1.0 of DNG standard
                  MadManChan2000 Adobe Employee
                  Basically different methods for reducing storage by exploiting properties of the human visual system, such as non-linearities in lightness, and the lowpass color sensitivity. (Standard JPEG compression basically destroys the color data but only very picky viewers can see the differences.)