Nuking the DNG Camera Profile [Now w/ script]

Here are Lightroom/Photoshop/Camera Raw lens profiles (RAW+JPG versions). These are only for RAW files that have been stripped of the embedded lens profile (at minimum "OpCodeList3" among others as desired). It will apply lens distortion correction (almost identical to DJI's profile except retaining a larger field of view and less distortion scaling), Vignetting and Aberrations.

I created these from shooting actual test charts using the P4A camera (official Adobe lens profile tool). I might go back a redo another set of test charts just to compare any variations that might show or increase accuracy further (see if I can get data closer into the 4 corners) but they appear to be good to go as is anyway.

*** Rename .txt to .lcp ***

In windows 10 and Lightroom CC the folder to place these files for Lightroom is:

C:\Users\username\AppData\Roaming\Adobe\CameraRaw\LensProfiles\1.0

Note change "username" to your user folder.
 

Attachments

  • FC6310 (24.0 mm) - RAW.txt
    8.4 KB · Views: 416
  • FC6310 (24.0 mm).txt
    8.3 KB · Views: 406
  • Like
Reactions: DaRana
Just to clarify my previous images and tests...

One important thing to note is that in the examples and when using a lens correction tool that bends inwards like in the photos then up scaling appears the end result to get back to 20MP. However its not really up scaled in this way. Using a proper lens profile it is bent (if you like) the other way (corners are pulled outwards rather than edges pushed inwards. The end result is still some stretching / up scaling of the outer edges along with some cropping (but not all of the image is up scaled).

This becomes apparently obvious when you toggle on/off the LR lens profiles I made.
 
  • Like
Reactions: DaRana
Sweet, Dingoz!! That’s awesome! Look forward to trying these out. I downloaded the lens profile tool previously, printed out a couple charts, then, OOH SHINY!! Needless to say I never got back to it. :)
 
Just to clarify my previous images and tests...

One important thing to note is that in the examples and when using a lens correction tool that bends inwards like in the photos then up scaling appears the end result to get back to 20MP. However its not really up scaled in this way. Using a proper lens profile it is bent (if you like) the other way (corners are pulled outwards rather than edges pushed inwards. The end result is still some stretching / up scaling of the outer edges along with some cropping (but not all of the image is up scaled).

This becomes apparently obvious when you toggle on/off the LR lens profiles I made.

Looks good Dingoz! Just did a quick test on a pic a shot tonight. Final image has a non-trivially larger field of view, and is noticeably sharper in the corners with the same settings. Color looks great with my default sunny profile layered on top.

Will test some more, this was just a quick trial. I'm going to have to think about whether or not to start stripping the profile on every shot as just a matter of standard workflow or not. Certainly don't want to keep the backup file! I did test importing a shot, then stripping the profile, as expected it works fine. Refresh metadata in lightroom and it updates the preview.

Hmmm, random thought, pretty sure that if we know the name of the lens profile that we couldn't apply the lens profile at the same time as we strip the built in profile.
 
  • Like
Reactions: Dingoz
Looks good Dingoz! Just did a quick test on a pic a shot tonight. Final image has a non-trivially larger field of view, and is noticeably sharper in the corners with the same settings. Color looks great with my default sunny profile layered on top.

Will test some more, this was just a quick trial. I'm going to have to think about whether or not to start stripping the profile on every shot as just a matter of standard workflow or not. Certainly don't want to keep the backup file! I did test importing a shot, then stripping the profile, as expected it works fine. Refresh metadata in lightroom and it updates the preview.

Hmmm, random thought, pretty sure that if we know the name of the lens profile that we couldn't apply the lens profile at the same time as we strip the built in profile.

Note I re-ran another set of charts getting deeper into the 4 corners with alignment. I posted V2 and the original renamed to V1 as above in this thread - also fixed the naming a bit so LR with auto pick it up most times when the box is ticked (most times - for some reason sometimes you still have to manually select DJI first):

Phantom 4 Pro/Adv Lightroom Lens Profile

I used your colour profiles too for a recent shoot... thanks for those.

Yes, I am in the same dilemma. What should my normal workflow be:

1. Just use DJI's RAW's.
2. Strip just lens profile and use my own versions of the lens profile (marginally larger FOV gained with both).
3. Strip lens and colour profiles and do it all.

Do not want double storage either. At this stage I think a stripped raw (despite extra work) is more like my preference for a base digital negative. This way I can choose how I process it from there. Use my lens profile (similar to DJI's adjustment) or use LR manual +100 correction (which down scales overall to about 13mp after crop but is a lot sharper - and for web display arguably better quality). Also have the various options of how to correct or not correct before stitching. So unless I can think of any negatives (other than extra work) I think options 2 or 3 provide more flexibility and a true raw digital negative to work from.
 
Very nice. Looks good, just gave them a quick test. Can see the difference in the lighting in the corner too, appears to be more even now. I didn't notice before but v1 seems like it was a touch inverse vignetted perhaps. Hard to tell for sure as I'm not using controlled images, but the bottom right corner appears to be slightly in v2 less sharp than in v1. But again, not using controlled images, just something I shot earlier which is all trees in the bottom corners so I'm just comparing small branches at 300% wide by side.

I'm leaning towards just stripping DJI profile as standard. I never use the embedded color profile, my default setting for the camera is to use my P4P__Sunny profile. With the lens profile you created I don't really see why not to do so - my only hesitation is I hate destructive edits so the idea of not being able to roll back to embedded profile should we discover something down the road makes me not super happy. I'm sure we could figure out putting it back, though, just by reversing the settings we kill. I think I just talked myself into it, actually.

So workflow would be:
1/ Import into lightroom like normal
2/ Right-click an image, select "open explorer"
3/ Run command prompt here
4/ I'll probably just toss the batch file into my PATH so I can just run it at the command prompt. If you change the command to run against *.dng it'll just hit everything in the folder that the bat was launched from.
5/ Refresh metadata in LR, generate previews

I'm sure it could be further automated, but that'll be a project for another day.

I updated the github repo with your instructions and profiles. Feel free to update!
GitHub - darana/P4P__color-profiles: Color profiles for the Phantom 4 Pro drone
 
Very nice. Looks good, just gave them a quick test. Can see the difference in the lighting in the corner too, appears to be more even now. I didn't notice before but v1 seems like it was a touch inverse vignetted perhaps. Hard to tell for sure as I'm not using controlled images, but the bottom right corner appears to be slightly in v2 less sharp than in v1. But again, not using controlled images, just something I shot earlier which is all trees in the bottom corners so I'm just comparing small branches at 300% wide by side.

I'm leaning towards just stripping DJI profile as standard. I never use the embedded color profile, my default setting for the camera is to use my P4P__Sunny profile. With the lens profile you created I don't really see why not to do so - my only hesitation is I hate destructive edits so the idea of not being able to roll back to embedded profile should we discover something down the road makes me not super happy. I'm sure we could figure out putting it back, though, just by reversing the settings we kill. I think I just talked myself into it, actually.

So workflow would be:
1/ Import into lightroom like normal
2/ Right-click an image, select "open explorer"
3/ Run command prompt here
4/ I'll probably just toss the batch file into my PATH so I can just run it at the command prompt. If you change the command to run against *.dng it'll just hit everything in the folder that the bat was launched from.
5/ Refresh metadata in LR, generate previews

I'm sure it could be further automated, but that'll be a project for another day.

I updated the github repo with your instructions and profiles. Feel free to update!
GitHub - darana/P4P__color-profiles: Color profiles for the Phantom 4 Pro drone

Yes I would not trust the vignetting or CA settings in those profiles to be accurate as the lightning was not setup to do so (the main goal was to simply get the distortion correct). Can simply cut all the V+CA tags out of the .lcp file and just leave the distortion tags if desired. (I can also generate the profiles without them if that's easier). V2 does stretch/correct a bit more distortion so should be a fraction softer again vs V1. V2 also has a fraction less FOV vs V1.

As for restoring a raw after stripping this would need the ability to extract the binary data of opcodelist3 among other binary data tags that are stripped. Not sure if exiftool can extract it and/or restore binary data. I am not so concerned about restoring... comparing everything before and after I can not see anything being lost of importance (that said we know we can re-strip a raw but not if we can re-apply stripped data). We are also not sure each raw has identical settings within the binary tags we are stripping.

Agree... a fully automated import process needs to be a to do task... will also look into this at some stage.
 
Here is V2 split into 3 options

D
D+CA
D+CA+V
 

Attachments

  • v2 Split.zip
    3.5 KB · Views: 216
  • Like
Reactions: DaRana
Agree... a fully automated import process needs to be a to do task... will also look into this at some stage.

I did a simple quick poweshell script last night to run the command, pipe it to screen and save it to a log file. It’s not fully automatic but I added the folder to my PATH statement so after import Right-clicking on an image I can one-click open the image folder then in Win10 you can shift+right click and get the open to “open power shell here” and just run the dngnukerator.ps1 script. It’ll run the strip command, removing the original files, pipe progress and verbose results to screen and save to those results a log file. 476 pics took a couple minutes. After it finished LR uodated it’s oreviews automatically. I just added the profile then.

The script is in the dngnukerator folder on the github repo. I’ll link it here directly later.
 
  • Like
Reactions: Dingoz
Here is V2 split into 3 options

D
D+CA
D+CA+V

Cool. Good to know that the V changes between profiles was due to lighting not being optimized for that. Thanks for the split version. I didn’t look to see about the CA. That’s one thing that’s been very good in the embedded profile. Wonder if that is in binary or if it is settings we can copy/merge into your profile
 
I kicked at JF Run Any Command, which I already use to do some batch scripting on export for my panoramas and HDRs earlier. But for some reason it's being wacky. I sent in a bug report. That would be ideal, as then in LR you can just highlight the folder/images and select the command from the menu, and just run the one line exiftool command to remove the profile.
 
Hmmm. So it isn't crazy but just confirming that the updated lens profiles (v1 and v2) do show a greater level of CA than the DJI profile. I'm not worried about vignetting levels but I don't think I've ever seen a spec of purple fringe in a P4P shot and I'm seeing some (not a ton, but it's there) in the lens profiles. It can come out w/ a quick-ish click of the defringe tool, but that's not as nice as having no fringe. :)

Anyways I know you said you never optimized for CA. Not sure yet what it takes to do so w/ the Adobe tool. If you know offhand let me know if it is something I can poke with a sharp stick.
 
Hmmm. So it isn't crazy but just confirming that the updated lens profiles (v1 and v2) do show a greater level of CA than the DJI profile. I'm not worried about vignetting levels but I don't think I've ever seen a spec of purple fringe in a P4P shot and I'm seeing some (not a ton, but it's there) in the lens profiles. It can come out w/ a quick-ish click of the defringe tool, but that's not as nice as having no fringe. :)

Anyways I know you said you never optimized for CA. Not sure yet what it takes to do so w/ the Adobe tool. If you know offhand let me know if it is something I can poke with a sharp stick.

Not sure about the lens tool but would think a better lighting setup might help.

I do not see any difference with or without CA used in the profile. I always tick the remove box in LR (I mean always and for every photo off every camera regardless). Its just a default on for me and solves most issues while creating none of it sown I have found. Once I have all my base tweaks dialled in I save those to the default import setting for that model camera so all new imports have the basics auto applied on import.
CA1.jpg
CA2.jpg
 
  • Like
Reactions: DaRana
I kicked at JF Run Any Command, which I already use to do some batch scripting on export for my panoramas and HDRs earlier. But for some reason it's being wacky. I sent in a bug report. That would be ideal, as then in LR you can just highlight the folder/images and select the command from the menu, and just run the one line exiftool command to remove the profile.

At the moment... I just have a temp folder for new import batches with the bat file in it.

1. I import new images into that temp folder
2. I run the bat file on all images
3. I cut all images and paste them into a new folder in my LR folder structure and sync LR to pick it them up

If possible, I need something to simplify these 3 steps. I do not use LR import process for cards inserted as I use my EOS utility for the DSLR for that. Never looked into using whatever LR offers vs EOS utility for importing. So really only trying to simplify step 1 and 2 (but I suppose its fairly easy already too).
 
  • Like
Reactions: DaRana
I’ll take a couple screenshots later. The CA was not bad, just to be clear. I was uber Pixel peeping to get there. It was in the extreme corners around backlit small branches - effectively the worst case scenario for Ca. :)

Re importing - I’ll also note that down, too. I’d highly recommend taking s look at LR import. It’s far superior IMO to the eos utility in its behavior, plus support for presets. The ability to set metadata, destination paths, custom develop presets (in addition to camera defaults as you noted), plus the expected items such as rename and auto folder creation as needed.

I’m pretty certain that I’ll be able to get do the profile strip from right within LR too, using Jeffrey’s Run Any Command plugin. There is an Example on the plugin page of running an exit tool command so it seems like it won’t be an issue. Just for some reason I can’t get that part of the plugin to work at all right now. Once that’s fixed though it’s a 2 step process. Import in LR, click menu item to run the predefined command and bye bye profiles.
 
  • Like
Reactions: Dingoz
At the moment... I just have a temp folder for new import batches with the bat file in it.

1. I import new images into that temp folder
2. I run the bat file on all images
3. I cut all images and paste them into a new folder in my LR folder structure and sync LR to pick it them up

If possible, I need something to simplify these 3 steps. I do not use LR import process for cards inserted as I use my EOS utility for the DSLR for that. Never looked into using whatever LR offers vs EOS utility for importing. So really only trying to simplify step 1 and 2 (but I suppose its fairly easy already too).

So, yeah, never got around to screenshots or anything. :) But wanted to update that I'm continuing to use your profile, @Dingoz! I've settled on Profile V1, with Distortion Slider at 100 and Vignetting slider at 75. I prefer the slightly less corrected in the corners version for sharpness.

Also, if you're up for tinkering with Powershell a little bit I've got a one-step ingest-rename-strip script running well enough for use. I spent a while updating the readme today in addition in the repo. When you run the script, it goes out to the memory card you've defined, grabs all of the files, sorts them into folders and renames to add datestamps and device stamps (you can change it in the script), then strips the -Opcode3 from any P4P DNG files it copied. You're left with folders ready to be imported into LR. Just ran an import, soooo much faster from a my time taken perspective. Just started the script and walked away, came back and just dropped the folder into LR where it just Added it and applied my develop preset defaults for that camera. All told almost no interaction ... other than of course constantly tweaking the script b/c I can't leave well enough alone. :)

Repo: GitHub - darana/P4P__color-profiles: Color profiles for the Phantom 4 Pro drone
The ingest script is in the ingest-all-the-things folder. For details about how it works, see Readme: GitHub - darana/P4P__color-profiles: Color profiles for the Phantom 4 Pro drone

Also in there are two updated dngnukerator powershell scripts, the one with -r runs recursively, the other one doesn't. These are straightforward strips that just run the command, but they dump out progress and also do verbose level 3 exiftool logging to log files.
 
  • Like
Reactions: Dingoz
I might be able to contribute to the OS X version. I can probably create a GUI droplet that will leverage exiftool in the shell the same way you process thru powershell. I’d skip the renaming and folder organization because some people use custom renaming and structure (like me). All that would be left is to do a standard import into Lightroom using a users own import method.

I’ve written a few exiftool scripts to fix gd iPhone video date metadata that Lightroom can read correctly.

If I get time.

I will post here the proper path to color profile on the mac for you to add in your readme later tonight. (It’s almost identical)
 
  • Like
Reactions: DaRana
I might be able to contribute to the OS X version. I can probably create a GUI droplet that will leverage exiftool in the shell the same way you process thru powershell. I’d skip the renaming and folder organization because some people use custom renaming and structure (like me). All that would be left is to do a standard import into Lightroom using a users own import method.

I’ve written a few exiftool scripts to fix gd iPhone video date metadata that Lightroom can read correctly.

If I get time.

I will post here the proper path to color profile on the mac for you to add in your readme later tonight. (It’s almost identical)

Thanks Ravedog! Paths would be great, I could have found them but since I can’t test didn’t want to document anything I wasn’t sure of. If you’re on Github feel free to do a pull request with updates, too, or just drop it here and I’ll add it in.

Yeah, the full ingest and rename is very much my own custom paths. I really wrote it for me (and as an exercise in powershell scripting) but made it a goal to be abstract enough others could use it. It’s written with all relative paths, so I just put a .symlink at the root of the tree and just run the powershell script from there and walk away.

Btw, the straight “dngnukerator.ps1” scripts just strip opcode without any of the ingest or renaming.

Hmm, might be time to revisit my iPhone scripts. I did the same as you, except my first versions used much more brute force methods and windows batch files instead.

Still on the todo is to make a tweaked version for video ingest.
 
  • Like
Reactions: ravedog
Thanks Ravedog! Paths would be great, I could have found them but since I can’t test didn’t want to document anything I wasn’t sure of. If you’re on Github feel free to do a pull request with updates, too, or just drop it here and I’ll add it in.


OS X Path (users Library folder)

~/Library/Application Support/Adobe/Camera Raw/CameraProfiles/
~/Library/Application Support/Adobe/Camera Raw/LensProfiles/1.0/DJI/

There is another repository for the profiles at the root Library folder on a startup drive:

/Library/Application Support/Adobe/Camera Raw/CameraProfiles/
/Library/Application Support/Adobe/Camera Raw/LensProfiles/1.0/DJI/

Hope this helps!
 

Members online

No members online now.

Forum statistics

Threads
143,066
Messages
1,467,354
Members
104,934
Latest member
jody.paugh@fullerandsons.