Q100419: Copying metadata from a source image into a sample EXR image

Follow

SUMMARY

Certain image files come with embedded metadata that define the parameters used when the image was originally created. Nuke allows the inspection and customisation of parts of this metadata, and also permits copying such metadata between images. 

There may be situations where you need to share metadata without providing the pixel data. This can be done in Nuke by copying the metadata from a source image, and inserting it into a sample EXR image. 

This article explains how to copy the metadata from a source image into a sample EXR image, using the CopyMetaData node and a CheckerBoard. 

 

MORE INFORMATION

Copying metadata

The following steps show how to copy the metadata of a source image into a CheckerBoard, without including any of the original pixel data:

1) Create a Read node and import the file that you wish to extract the metadata information from.

2) Create a CheckerBoard node.

3) Create a CopyMetaData node and set the metadata from knob to meta only.

4) Connect the Meta input from the CopyMetaData to the Read node and the Image input into the CheckerBoard node.

marcie.PNG

5) Create a Write node and, on this Write node:

a) Select a directory to create the rendered image, ensuring that the render is set to use the EXR file extension.

b) Set the metadata knob to all metadata

Write.PNG

7) Render the EXR file using the Render button.

8) To view the results of the render, bring the file back in using a new Read node.

Result: You will now have a CheckerBoard image that contains the metadata and not the original pixel data. 

9) To inspect the copied metadata, go to the Metadata tab of CheckerBoard Read node. The results of this will show the embedded metadata.

10) To confirm this metadata matches the original, create a CompareMetaData node and connect the A input into the original Read node and the B input into the rendered CheckerBoard Read node.

Comparemeta.PNG  Comparemeta2.PNG

NOTE: The two files will not match 100 percent when compared as filesizes, filenames, but most embedded metadata should be present. 

 

Removing metadata 

If there is any metadata you would like to exclude from the rendered EXR, you can remove this from the metadata by using a ModifyMetaData node:

1) In the example workflow above, create a ModifyMetaData node between the CopyMetaData and Write nodes

modify.PNG

2) In the ModifyMetaData properties bin, create a new action by clicking the + knob.

3) Once this is clicked, you will see a set value created under the action heading of the table.

set.PNG

4) Double-click on the set entry and this will prompt you to either keep set or change to remove. Select remove.

5) Double-click the empty area to the right of the set value (within the key heading of the table.)

6) When the 'Pick metadata key' window appears, select the metadata value you would like to remove.

As an example, I am selecting the 'creator' metadata value to exclude in the image below:

remove_metadata.PNG

7) Re-render using the Write node.

8) Read in the newly revised render and you can see that the value you have removed will not be included in the revised EXR image metadata.

Please note, as EXR files are currently the only format within Nuke that allows exporting of custom metadata, this technique is limited to rendering as EXR files. However, we have an open feature request to include writing additional formats, which can be referenced as:

ID 382642 - Add the ability to read and write all metadata from all supported file formats

 

ADDITIONAL INFORMATION

For more information on working with file metadata in Nuke, using ModifyMetaData and CopyMetaData nodes, or rendering metadata, please refer to the following sections of Nuke's online documentation:

    We're sorry to hear that

    Please tell us why