5 Replies Latest reply on Nov 28, 2017 7:55 AM by jeremyjp

    Removing Embedded Profile in DNG file

    andy_kay

      Is there any way to remove an embedded camera profile from within a DNG file?

       

      Please see below (sorry if it's a bit 'image heavy')

       

      Below is image is taken direct from the SD card of my DJI Phantom 4 Pro and loaded into Camera Raw, it's their supposed 'raw' file from a 20mp Sony sensor (fit to screen) and is written by the camera as a DNG file

       

      acraw.jpg

       

      The second image shows exactly the same raw file opened in UFRaw (RawTherapee gives the same result)

       

      ufraw.jpg

       

      What is immediiately apparent is that the UFRaw view had roughly a 20% wider viewpoint, shows vignetting at the corners and there is evidence of barrel distortion - these examples are 16:9 and it's even more evident on the supposedly 'native' 3:2

       

      sensorsooc.jpg

      The DNG image opened by Adobe Camera Raw has already been 'warped' and cropped before opening - rough example here

      sensor_area_sm.jpg

      The 'full image' is the correct pixel count/proportions but the DNG file as read by Adobe Camera Raw is also the same dimensions but, it is a significantly lower quality as it has been warped, cropped and scaled to refit the 20mp proportions

       

      Extreme top left, 100% crop of both versions of the same DNG file (Raw Therapee on the left, ACR on the right). This clearly shows that ACR is displaying an edited file presumably from the embedded profile.

      scaling-eg2.png

       

      Thanks for reading and if anybody has any ideas as to how I can persuade ACR to ignore the embedded profile and display the same (warts and all) image as the other raw editors I would be very pleased to hear your thoughts.

       

      Cheers

        • 2. Re: Removing Embedded Profile in DNG file
          andy_kay Level 1

          Thanks Sandy, just to further complicate things I'm running a windows system - the only DNG cleaner I can find is DJI's own one - which (unsurprisingly) won't touch DNG files written by the Phantom 4 Pro

          • 3. Re: Removing Embedded Profile in DNG file
            jeremyjp Level 1

            Did you ever find a solution? I'm looking for the same thing.

            • 4. Re: Removing Embedded Profile in DNG file
              Stephen_A_Marsh Adobe Community Professional

              Can you post a download link to a DNG that has not been edited, straight off the camera?

               

              I may be wrong, however looking at some OEM samples with ExifTool, I don’t believe that there is any metadata that can be removed using ExifTool that will create a different result in ACR/Lightroom vs. other software (i.e. this is how Adobe have designed and hard coded their raw converter to behave). Or perhaps it is just that ExifTool does not see this data and the tools such as DNG Cleaner do.

               

              This is not unique to this camera make/model, I have seen similar reported with other cameras where there are more pixels available to other softwar.

              • 5. Re: Removing Embedded Profile in DNG file
                jeremyjp Level 1

                So if anyone is looking for a solution, the answer is Yes you can. Here's the command below. Everything referenced here is available (and possibly an updated version) in the GitHub repo at github.com/darana/P4P__color-profiles

                 

                Simple answer is to use EXIFTOOL to strip -OpcodeList3 from the file. This EXIF field contains the binary data that equates to the lens profile. Here's the command (link to readme on GitHub)

                 

                exiftool.exe -OpcodeList3= -m -overwrite_original -progress -v3 -ext DNG -if "$EXIF:OpcodeList3 ne ''" FILENAME\PATH
                

                 

                • Runs Exiftool program and -OpcodeList3= sets that field to null, i.e. deleting it.
                • -m suppresses low priority warnings. There is a message about offset that will come up for every single file, otherwise.
                • overwrite original well, overwrites your original
                • -ext DNG tells the command only to run against DNG files, whether you specify a filename or a folder/path
                • -progress and -v3 provide detailed progress and logging
                • -if "$EXIF:OpcodeList3 ne ''" makes the command conditional, running against the file only if the file's -OpcodeList3 isn't already blank. This is optional, I just use it to speed things up in the case where I have already run against part of the list.
                • FILENAME\PATH is the filename or the folder of files to execute against.

                 

                So I got tired of running this command, and having multiple steps to ingest, so wrote a full ingest, rename, then nuke the profile powershell script for Windows. The details are here with download link With this workflow, I run the Powershell script, which pulls everything in, sorts into folders by date, strips the profile, then I ADD to Lightroom. Saves a lot of headache with ingesting, then updating metadata and previews.

                 

                As you noted, @andy_kay, you will then be left with a file with all of the barrel distortion of lens, so you'll need to either apply distortion, or use another lens profile. We've got one created, however, thanks to Dingoz at PhantomPilots.com. He created this using the Adobe Lens Profile Tool. Do note that he focused on distortion so the vignetting may not be perfect. There are actually two versions of it, v2 has greater distortion into the corners, but I find that I prefer v1, which retains a bit more sharpness to the edges. My default is to use v1 with 100 distortion and 75 vignetting sliders. Here are the profiles documentation with download link.

                 

                And last but not least, there are Color Profiles for the P4P created with a Colorchecker Passport under various lighting conditions.

                1 person found this helpful