You are here: User Guide > Nuke > Configuring Nuke > Defining Common Image Formats

Defining Common Image Formats

You may wish to define image formats (image resolutions and corresponding pixel aspect ratios) for a given project. These appear as dropdown menus on Read and Reformat nodes.

Defining an Image Format

To define an image format:

1.   If you haven’t already done so, create a file called menu.py in your plug-in path directory.

For more information on plug-in path directories, see Loading Gizmos, NDK Plug-ins, and Python and TCL Scripts.

2.   Add an entry in the following format:

nuke.addFormat(" ImageWidth ImageHeight LowerLeftCorner LowerRightCorner UpperRightCorner UpperLeftCorner PixelAspectRatio DisplayName ")

• Replace ImageWidth with the width (in pixels) of the image format.

• Replace ImageHeight with the height (in pixels) of the image format.

• If you wish to define an image area that is smaller than the format resolution, replace LowerLeftCorner, LowerRightCorner, UppperRightCorner, UpperLeftCorner with the proper x and y coordinates (in pixels) for the lower left, lower right, upper right, and upper left corners of this smaller image area (optional).

• Replace DisplayName with display name of the format. This appears on all relevant dropdown menus.

Example 1

The following entry would create a new format called full_aperature_anamorphic with a resolution of 2048 by 1556 and a pixel aspect ratio of 2.0. (As the image corners are not explicitly defined, the image covers the entirety of the format area.)

nuke.addFormat (" 2048 1556 2.0 full_aperture_anamorphic ")