5 Replies Latest reply on Sep 30, 2016 5:52 PM by johnrellis

    Basic tone settings affect raw and TIFFs differently?

    johnrellis Most Valuable Participant

      Why do basic tone settings (exposure, contrast, highlights, shadows, whites, blacks) affect raws and TIFFs differently?

       

      As an experiment, I exported a raw as a 16-bit ProPhoto TIFF and imported the TIFF into LR. Then I applied the same preset to both the raw and the TIFF. Perhaps naively, I expected the results to be nearly identical, but in fact they're noticeably different.

       

      Why would they be different?  LR converts both the raw and the TIFF to its internal working color space before applying any edits.  Before applying the preset, the images look identical in Develop, as you'd expect; but after applying the preset, they are different. That implies there's some difference between the raw and the TIFF, other than the pixel values in the internal working space, that is affecting the computation of the basic tone settings.

       

      Obviously, in general raws have different information than TIFFs. But what specifically would cause, say, Exposure to yield different results, given the pixel values for the two images in the internal working space are identical or nearly identical?

       

      I first noticed this with my most popular plugin, which customers use to convert LR develop settings to LUTs that can be used for video color grading.  The LUTs are created by exporting TIFFs to which the desired develop settings have been applied, and exporting a TIFF from a raw produces different results than exporting a TIFF from a TIFF with the same develop settings applied.  The upshot is that I have to tell customers never to use raws when creating their looks.

       

      But there's a broader impact of this: It's often suggested that LR users convert raws to TIFFs when their cameras aren't yet supported by LR. They should be aware that even basic tone edits to the TIFFs will produce different results than edits applied to the original raws.

       

      Informed speculation is welcome, though of course, authoritative answers would be better!

       

      * * *

       

      Details

       

      If you'd like to play along at home, download this .zip: https://dl.dropboxusercontent.com/u/21811200/raw-versus-tiff.2016.09.26.zip

       

      "raw.arw" is the original raw.

       

      "tiff.tif" is the original raw exported as a 16-bit ProPhoto TIFF and reimported into LR.

       

      The preset "Edit.lrtemplate" applies these settings:

      settings.png

      "raw-preset.tif" and "tiff-preset.tif" are the results of applying the preset to "raw.arw" and "tiff.tif" and exporting the results as 16-bit ProPhoto TIFFs.  If you import them into LR, Photoshop, or a previewer and flip between them, you can easily see the differences.

       

      To get a more precise understanding of the differences between the two images, I loaded "raw-preset.tif" and "tiff-preset.tif" into Photoshop as layers, set the blend mode to difference, flattened the result, and then applied the Levels command, changing the upper bound from 255 to 15:diff-hist-15-preset.png

      This shows that the luminance of the pixel values differ as much as 14/255 (5.5%), but most of the pixels differ between 1/255 and 6/255 (2.4%).

        • 1. Re: Basic tone settings affect raw and TIFFs differently?
          trshaner Adobe Community Professional & MVP

          johnrellis wrote:

           

          Why do basic tone settings (exposure, contrast, highlights, shadows, whites, blacks) affect raws and TIFFs differently?

           

          As an experiment, I exported a raw as a 16-bit ProPhoto TIFF and imported the TIFF into LR. Then I applied the same preset to both the raw and the TIFF. Perhaps naively, I expected the results to be nearly identical, but in fact they're noticeably different.

           

          LR's Tone controls are "image adaptive." With all Tone controls set to 0 the "actual settings" applied varies based on the image file's dynamic range and subject content. Low contrast images with only midtones and no dark shadows or bright highlights will be least affected (difference between raw and TIFF files). Conversely, images with dark shadows and/or bright highlights will show greater differences between raw and TIFF processing. When the raw image file is exported to TIFF the Blacks and Whites levels are set causing the image to have less dynamic range. The Tone controls will behave differently with the TIFF file due to their "adapting" to the lower dynamic range of the image file.

           

          You should still be able to make the raw and TIFF files look near identical, but you will have to use slightly different Tone control settings. The one exception is when processing image files with highlight clipping. If you export to TIFF with clipped highlights that image data is lost permanently. With the raw image file LR is able to recover all or at least some of those clipped highlights.

          • 2. Re: Basic tone settings affect raw and TIFFs differently?
            johnrellis Most Valuable Participant
            LR's Tone controls are "image adaptive." With all Tone controls set to 0 the "actual settings" applied varies based on the image file's dynamic range and subject content.

            My model of how Develop works is that the image is logically converted into the internal working space (which uses MelissaRGB) and the Develop settings applied to the pixel values in the working space.   The raw and exported TIFF would have identical pixel values when converted to working space, and thus the image-adaptive controls would yield the same results.

             

            But my model doesn't correspond with the results of applying the basic tone settings, so it can't be correct.  What is the correct mathematical model of how LR manipulates images internally?

            • 3. Re: Basic tone settings affect raw and TIFFs differently?
              trshaner Adobe Community Professional & MVP

              johnrellis wrote:

               

              But my model doesn't correspond with the results of applying the basic tone settings, so it can't be correct. What is the correct mathematical model of how LR manipulates images internally?

              There's a white paper available and some information at this post:

              “Image Adaptive” Controls

               

              When a raw image file is opened in LR the PV2012 controls apply highlight recovery and set the Black Point automatically, even with the controls all set to 0. When you Export to TIFF the image file now has a "fixed" Black Point and some highlight recovery applied. However, no automatic highlight recovery or Black Point setting is applied to non-raw files when the Tone controls are set to 0. Because of this the raw and TIFF files should like identical. If you move any of the Tone controls off their 0 setting the raw and TIFF file may look different due to the "image adaptive" algorithm used for calculating the new setting. That's also why it is advisable to adjust the PV2012 Tone controls from the top and down starting with the Exposure control. Each control adjustment affects the others and Adobe has organized the controls to produce the least interaction when they are adjusted in a top-down workflow.

               

              I've provided a detailed tutorial on using the PV2012 Tone controls at this post, which may be helpful:

               

              Re: camera calibration profiles: standard vs neutral

              • 4. Re: Basic tone settings affect raw and TIFFs differently?
                johnrellis Most Valuable Participant

                Thanks, I'll absorb that information and see if it answers my underlying questions about the internal working space.

                • 5. Re: Basic tone settings affect raw and TIFFs differently?
                  johnrellis Most Valuable Participant

                  When a raw image file is opened in LR the PV2012 controls apply highlight recovery and set the Black Point automatically,even with the controls all set to 0.

                  OK, this would explain why my model was incorrect. 

                   

                  The internal working space for the raw file contains the original pixel values along with two hidden develop settings, the automatically applied highlight recover and the black point. The exported TIFF contains the original pixel values as modified by those two hidden settings.   So when the TIFF is reimported, its pixels in the internal working space do not match the original pixel values in the raw's working space.  So contrary to my model, the basic tone settings (which are image-adaptive) are working on different sets of pixel values in the two working spaces, and thus they can produce slightly different results.

                   

                  Thanks much.