The format of a script is the pixel dimensions (and pixel aspect ratio) of the final output. It is, effectively, the dimensions in pixels of the paper that you are doing your drawing on. This value should be knowing set at the beginning of the project, and carfully maintained throughout. If not, then your scrip could quickly become a troublesome mess.
Related to the format are two other notions: the 'bounding box' and 'black outside'.
- 1 Format, Bounding Box and Black Outside
- 2 Things to remember
- 3 What to Do if Something Goes Wrong
Format, Bounding Box and Black Outside
Three principles govern format management: format, bounding box and black outside. They are usually considered in relation to each other.
The Project Settings is where the 'top level' settings for your script are stored. These are: the 'format' that you are working in, the 'frame range' (how many frames your project has) and the 'fps' (frames per second)of the result. Of these the format is the most important and is the FIRST thing that you will need to set when you start your script. To find the settings simply mouse click once anywhere in the Node Graph and press the S key. If you are anywhere else other than the Node view then you might get the wrong settings (e.g. the viewer area has its own settings).
The Reformat node simply reformats to a target format any source that is fed into it. The top parameters ('type' and 'output format') control the size of the target format. The drop-down list of output formats contains a list of all common formats that Nuke recognizes. At the bottom of this list are automatically included any non-standard formats used within the script. If you wish to reformat to a value not on this list, then the 'type' value may be changed to 'box', which allows any dimensions to be specified.
The bottom parameters control how the reformat is committed. This is needed when the target format is not the same proportion and the source format. In such a case you will have to decide whether to preserve the width of the source, or its height. The 'resize type' parameter controls this behavior. The other key parameter is black outside, which controls what happens to any 'void' space within the image.
In the third image below, this void space is filled with stretched pixels. In the forth image, black outside fills this with black. Remember: the black outside behavior extends to the alpha.
This node can also be used to 'flip' or 'flop' the image. This is actually rather useful for checking the 'visual togetherness' of a composite (painters traditionally do a similar thing when they check their painting in the mirror).
It can be processor intensive to reformat a read, especially an image sequence. You should consider rendering out the reformat material and reading it back in.
The Reformat should not be used to fix problems caused by setting the format wrong in Project Settings.
The Bounding Box
The bounding box is a region that defines the limits of what is being processed by Nuke. If this is set too large for what needs to be processed, then Nuke wastes a lot of processing power. This is particularly so in filtering operations such as blur and defocus. Certainly, it is rare that anything needs to be processed that lays outside the limits of the Format.
They most important node in the management of the bounding box is the Merge node. If two images are laid over each other, and one is larger than the other, then by default Nuke will assume that the bounding box should be large enough to accommodate them both. In the image below, a green rectangle has been made very large with a Transform node. In the viewer, the bounding box is the dotted line that extends beyond the format.
If the 'set bbox to' parameter is changed to 'B' then the bounding box shrinks to the size of the format.
Other bounding box related nodes are:
AdjBBox: this will increase or decrease the size of the bounding box.
CopyBBox: this will copy the bounding box from one input to another.
Crop: Similar to AdjBBox, this adjusts the size of the bounding box. Howvere, it offers more controls than AdjBBox, allowing arbitrary repositioning of the edges. using it, the format can also be changed.
A clear video explaining the bounding box can be found here.
Occasionally in your Nuke travels you will find yourself looking at weird streaky pixels in the Viewer (the Nuke manual calls them stripes). These typically appear after using a Reformat or Transform node. Example below:
The black outside parameter also effects the alpha, so it can impact upon your merging operations. There is, by the way, a dedicated BlackOutside node that forces everything outside the bounding box to be black.
Things to remember
New formats and the format list
Nuke's default drop-down menu list Contains all the standard format flavors: HD, PAL, NTSC, 4K etc. Should so where in your script a new format be introduced, then it's format will automatically be added to the bottom of this list.
The Read node and its format parameter
Though it might seem strange, the 'format' parameter in the Read node does NOT change the format of the read in file. This parameter reflects the Read nodes 'best guess' at what the format of the read-in file might be. If it guesses wrong then this value can be edited (there are a few, obscure reasons why this value might need such an edit that I shall not go into here). Generally this value should be ignored.
The merge node format inheritance
Should two different fortmats enter the Merge node, the result will inherit the format of the 'B' feed. This is another reason to observe the Primacy of the B Feed. Should this be a problem, dont forget the marvelous 'under' merge operation which will place the 'B' feed under the 'A' feed.
Creation nodes and format
Nuke's 'creation' nodes (the Constant, CheckerBoard, ColorBar etc) inherit their default format from the Project Settings. These nodes are commonly found at the end of a node tree batch (they have no input feed). From the point, all downstream nodes inherit the same format. It therefore make sense that their format is independently editable through its own drop-down menu.
In Nuke, 2D positional values are refered to in the form of a coordinate (X and Y) or size (pixel dimentions). Both these make the asumption that the zero / zero value is located in the bottom left hand corner. Interesting much? A bit, maybe.
What to Do if Something Goes Wrong
The following assumes that the 'format has been set correctly in the Project Settings.
If the format behaves weirdly after a merge
The chances are that either your forground ('A' feed) or background ('B' feed) is the wrong format. To fix:
- Use an 'under' merge instead of an 'over'.
- Use a Reformat. Place just above whichever of the merge feeds is giving you trouble.
- If, after reformatting, the forground or background looks too big or small, then place a Transform before the reformat and review accordingly, or...
- ...in the Refromat node, change the 'resize type' parameter from 'width' to height'.
If the Viewer widgets are not aligning correctly
An example of the above is when the onscreen widget of a Transform node is moved a particular distance, yet it's related object moves twice or half that distance. This can make on screen edits difficult to perform.
- This might actually be because the transform order of stacked Transforms is wrong (not really a format issue as such), or...
- ... it might be because the there is disagreement between the format of the Transform and whatever it is transforming. A Roto will inherit the format of whatever is above is, so simply place a Reformat node above the Roto set to the correct format.
If you forget all else, remember these facts:
- Set the format of the project correctly in the project settings.
- A node will inherit the format of whatever is furthest up steam (i.e. the end of the branch). Simply place a Reformat node here to govern the format of anything downstream. This is particularly useful for reformatting badly behaved Roto nodes.
- In the case of the preceding, this does not always work. Some nodes are 'terminal' and have no input feed. Xxx
- Some nodes have their own format options. These include the Draw nodes.
- Manage the Bounding Box. Set incorrectly, a bounding box can slow the render of your script, turning compositing into a tiresome drag. This will include a frequent use of the 'set bbox to' parameter in the Merge node.