News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Extract info from Nikon NEF edited by Nikon NX Studio

Started by Joanna Carter, December 26, 2021, 09:01:54 AM

Previous topic - Next topic

Joanna Carter

Out of curiosity, I used Nikon NX Studio to edit a Nikon NEF image file and, to my surprise, the changes are saved inside the NEF file but are not visible in any regular viewing software, apart from NX Studio, even macOS Finder will not show the changed preview.

Does anyone have any idea if either the edited preview jpeg (or other), or perhaps the editing parameters, is accessible via ExifTool?

StarGeek

Not directly.  You'd have to pipe the output into another instance of exiftool.  See this piping example command.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Joanna Carter

Thanks for your thoughts, which, in this case, ended up being totally irrelevant but did act as "rubber duck consulting" in prompting me to open the NEF file in a text comparison tool to see how and where the editing data is stored.

Believe it or not, it is just a section that starts with "NIKON APP" and is, essentially, an XML packet tacked on the end of the image data, in the same way that ExifTool write its packet before the beginning.

I don't know where, if anywhere, I'm going to take this, but it does open up the possibility of being able to access Nikon's editing data should I find a use for it.

Thanks

Joanna

Phil Harvey

ExifTool extracts editing information from Nikon Capture NX.  I don't know about NX Studio, but if the information is the same format then ExifTool should extract at least some of it.

If you send me a sample I'll take a look (philharvey66 at gmail.com).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Joanna Carter

Hi Phil

A merry whatsit and a happy new thingy to you  ;D

I have sent you a link to a file by email.

I tried using the NikonCapture tag and it returned nothing, so its looks like things might be a bit different.

Joanna

Phil Harvey

Hi Joanna,

Thanks for the sample.  This trailer is new to me -- I'll see about adding basic support for this.

I've downloaded Nikon NX Studio, but for me it is writing NKSC sidecar files instead of adding a trailer.  I don't see where I can get it to write editing parameters to the NEF file.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Joanna Carter

Ah. You need to go into Preferences and set it under the "Save" item - see the attached screenshot. Sorry it is in French but Studio seems to be a single language install.

I've also extracted the trailer in a .txt file if it makes life any easier.

Joanna


Phil Harvey

Thanks, that did it.  Now I can produce these myself, which make it much easier for me to test various things.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

ExifTool 12.39 has just been released and has the ability to read these NikonApp trailers (as well as support for NKSC files).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Joanna Carter

This is great news - and so fast!  :D

The only thing missing seems to be any documentation. Is it me that can't find it or is it that you haven't yet had the time to create it?

Nonetheless, thank you so much for all the work you have already done and the great support you provide.

Joanna

Phil Harvey

I'm not sure what type of documentation you want, but it is sort of disconnected and not well documented because it is XMP based and only selected tags have been pre-defined.  See the Nikon XMP tags here:

https://exiftool.org/TagNames/Nikon.html#ast

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Joanna Carter

What I was looking for was a way to extract the large block of XMP data that describes the editing parameters applied to the image.

It contains all sorts off stuff like...
Quote
             <filter id="nikon::QuickFixToneCurve">
               <active>true</active>
               <parameters>
                 <double name="QuickFixToneCurve.ymax">1</double>
                 <double name="QuickFixToneCurve.ymin">0</double>
                 <double name="QuickFixToneCurve.black">0</double>
                 <double name="QuickFixToneCurve.gammaVal">1</double>
                 <double name="QuickFixToneCurve.white">1</double>
                 <points name="QuickFixToneCurve.pointsOut">
                   <pointOfPoints x="0" y="0"/>
                   <pointOfPoints x="1" y="1"/>
                 </points>
               </parameters>
             </filter>
             <filter id="nik::GaussianBlur">
               <active>false</active>
               <parameters>
                 <integer name="Opacity">100</integer>
                 <double name="RadiusNew">1</double>
               </parameters>
             </filter>
             <filter id="nikon::LEGeneral">
               <active>false</active>
               <parameters>
                 <EasySharpening>0</EasySharpening>
               </parameters>
             </filter>
             <filter id="Nikon::FishEye">
               <active>false</active>
               <parameters>
                 <EmptyAreas>false</EmptyAreas>
                 <FillColor>3</FillColor>
                 <Version>2</Version>
               </parameters>
             </filter>
             <filter id="nikon::ColorBalance">
               <active>true</active>
               <parameters>
                 <integer name="ColorBalance.slBrightness">0</integer>
                 <integer name="ColorBalance.slContrast">0</integer>
                 <integer name="ColorBalance.slRed">0</integer>
                 <integer name="ColorBalance.slGreen">0</integer>
                 <integer name="ColorBalance.slBlue">0</integer>
               </parameters>
             </filter>
... to quote but a small part.

I guess I was looking for a tag that returned that XMP block, but if it's not available, then so be it.

---

Hang on, is it in the "Nikon NineEdits" tag under "FilterParametersBinary" ?

Phil Harvey

The tag you want is "XMLPackets", but you will have to decode this from Base64.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Joanna Carter

Sorry it's taken a while to reply.

I don't know what XMLPackets really holds because all I get is...


XML Packets                     : (Binary data 3918 bytes, use -b option to extract)


... but if I use...


exiftool -nineedits -b myfile.NEF


... I get exactly what I want. A juicy 1496 bytes of expected binary data that I can read into a dictionary with a simple decoder.

If I get enough time, I may start to play with the resulting data. So far, it's been a simple challenge to get to it but, having got to it, I'm not sure just how useful it's going to be in relation to what I had in mind, which is a sort of edits converter to another app's sidecar format.

Thank you for providing the access. I'll let you know if it is really of any use.