Reformat
Reformat lets you resize and reposition your image sequences to a different format (width and height). This also allows you to use plates of varying image resolution on a single script without running into issues when combining them. All scripts should include Reformat nodes after each Read node to specify, at the very least, the output resolution of the images in the script.
Inputs and Controls
Connection Type |
Connection Name |
Function |
Input |
unnamed |
The image to resize. |
Control (UI) |
Knob (Scripting) |
Default Value |
Function |
Reformat Tab |
|||
type |
type |
to format |
Select how to resize the image: • to format - Set the output width and height to the selected format. Choose the format in the output format dropdown menu. If the format does not yet exist, you can select new to create a new format from scratch. The default setting, root.format, resizes the image to the format indicated on the Project Settings dialog. • to box - Set the output width and height to dimensions you define (in pixels). Enter values in the width/height and pixel aspect fields to specify the dimensions. This option is useful for creating a thumbnail of the input image. • scale - Set the output width and height to a multiple of the input size. Use the scale slider to define the factor. The scale factor is rounded slightly, so that the output image is an integer number of pixels in the direction chosen under resize type. |
output format |
format |
root.format |
The format to which you want to output the image sequence. If the format does not yet exist, you can select new to create a new format from scratch. The default setting, root.format, resizes the image to the format indicated in the Project Settings. This control is only available if you have set type to to format. |
width/height |
box_width |
200 |
The output width for your image. The units are in pixels. This control is only available if you have set type to to box. |
box_height |
200 |
The output height for your image. The units are in pixels. This control is only available if you have set type to to box. |
|
force this shape |
box_fixed |
disabled |
When enabled, the output image matches the width/height fields exactly, even if the original image is a different shape. To achieve this, one direction gets either clipped or padded. When disabled, the output image is approximately the same shape as the original, rounded to the nearest integer number of pixels. This control is only available if you have set type to to box. |
pixel aspect |
box_pixel_aspect |
1 |
Sets the pixel aspect ratio for the output image. This control is only available if you have set type to to box. |
scale |
scale |
1 |
The scale factor for the width and the height. To scale each direction separately using different scale factors, click the 2 button. This control is only available if you have set type to scale. |
resize type |
resize |
width |
Choose the method by which you preserve or override the original pixel aspect ratio. Select: • none - to not resize the original. • width - to scale the original until its width matches the output width. Height is then scaled in such a manner as to preserve the original aspect ratio. • height - to scale the original so that it fills the output height. Width is then scaled in such a manner as to preserve the original aspect ratio. • fit - to scale the original so that its smallest side fills the output width or height. The longest side is then scaled in such a manner as to preserve the original aspect ratio. • fill - to scale the original so that its longest side fills the output width or height. The smallest side is then scaled in such a manner as to preserve the original aspect ratio. • distort - to scale the original so that both sides fill the output dimensions. This option does not preserve the original aspect ratio, so distortions may occur. |
center |
center |
enabled |
When enabled, Reformat translates the image to center it in the output. When disabled, Reformat translates the image so that the lower left corners line up. |
flip |
flip |
disabled |
When enabled, Reformat flips the image upside down. |
flop |
flop |
disabled |
When enabled, Reformat flops the image left and right. |
turn |
turn |
disabled |
When enabled, Reformat rotates the image 90 degrees counter-clockwise. |
filter |
filter |
Cubic |
Select the filtering algorithm to use when remapping pixels from their original positions to new positions. This allows you to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values). • Impulse - remapped pixels carry their original values. • Cubic - remapped pixels receive some smoothing. • Keys - remapped pixels receive some smoothing, plus minor sharpening (as shown by the negative -y portions of the curve). • Simon - remapped pixels receive some smoothing, plus medium sharpening (as shown by the negative -y portions of the curve). • Rifman - remapped pixels receive some smoothing, plus significant sharpening (as shown by the negative -y portions of the curve). • Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation. • Parzen - remapped pixels receive the greatest smoothing of all filters. • Notch - remapped pixels receive flat smoothing (which tends to hide moire patterns). • Lanczos4, Lanczos6, and Sinc4 - remapped pixels receive sharpening which can be useful for scaling down. Lanczos4 provides the least sharpening and Sinc4 the most. |
clamp |
clamp |
disabled |
When using filters that employ sharpening, such as Rifman and Lanczos, you may see a haloing effect. If necessary, check clamp to correct this problem. |
black outside |
black_outside |
enabled |
This renders as black pixels outside the image boundary, making it easier to layer the element over another. If you uncheck this control, the outside area is filled with the outermost pixels of the image sequence. In most cases, you should keep black outside checked. However, you may want to turn this off for camera shake, or if you want to texture-map or intersect the output with a similar shape. Note: Enabling black outside also adds a solid alpha covering the input image area if no alpha is present. |
preserve bounding box |
pbb |
disabled |
When enabled, pixels outside the output format are preserved. When disabled, pixels outside the output format are clipped off. |
Step-by-Step Guides
Video Tutorials
Working with Transforms from Foundry on Vimeo.
We are now ready to move on to the transformations in Nuke and, in fact, Nuke does require a node to transform. In fact, there is a node called Transform. For example, if I select Read2 for this spaceship render, I can right-mouse-button-click and choose Transform > Transform, or press the T key, and there’s a Transform node. As soon as the node has its properties open in the properties panel, you will see an interactive handle in the Viewer. Let me disconnect the B input from Merge, so you can see that better. There it is. Now, you can either transform this interactively or change the properties. For example, you can rotate or scale. There is also a center x and y. This is a point in screen space where the transform handle rests and the transformations happen from. Now, it might be nice to get this handle in the center of the ship. You can do that by changing the center x and y values. So, there is 1100 and 500 for x and y, and now the handle is here. You can also move this handle interactively. If you click+drag in the center of the circle, you can translate. If you click+drag the long arm on the right, that rotates. If you click+drag one of the arcs of the circle, that will scale evenly in the x and y. Or you can click+drag one of the dots on the circle to scale unevenly, and also skew, which is a trapezoidal distortion, by grabbing the short lines. Now, you can animate all of these properties over time. In fact, we will discuss that in the next video.
For now, I want to talk about a few other issues associated with transformations, which are useful to know. So, let’s go ahead and hook up the background once again, and I will zoom out. You will notice, because I have changed some of the transformation of the ship, its bounding box overhangs the bounding box of the background. That’s OK. Now there is a tool to help you keep track of where the edges of the frame are. There is a guide button right here. If you click that, you can turn on one of these guides, for example action safe. So I know if I move my ship too close to the edge, past the white line, it might get cut off on certain TVs or screens. There is also a title safe. Now, if you don’t want to see any guides, simply turn it back to no guides. A new feature of version 7 is the mask button. You can use it by going to mask ratio and picking a new mask ratio that is different to your current one. Now, the current ratio is 16:9 - it is basically high definition widescreen. If I pick a different ratio - 4:3, which is standard television - and then turn on my masks, like half, you will see this crops off the corners. This shows you what would happen if you had to convert the 16:9 to 4:3. Now if you want to turn it off, return that button to no mask.
Another issue associated with transformations is reformatting. Reformatting is something you can do when you are working with footage that has different resolutions. Let me go to Read1 and bring in a different background. I am going to grab another image, this one is just called Sky, and because it is a different size and different resolution, my frame looks different. My new sky is only 1280x960, which is much smaller. You can solve that, though, by reformatting. If I choose the Read1 node, I can right-mouse-button-click and Transform > Reformat. Reformat will force the sky to be the same size as the ship. Now, the fact I have a Transform on the ship node, is going to continue to give me an overhanging bounding box, but now if I go ahead and delete my Transform, let’s see what happens. I will zoom in, the ship and the reformatted sky are the same size, so everything fits perfectly and there are no overhanging images. The Reformat works by simply scaling. If you look at the properties up here at the top, you can see that is scaled to the current root format, which is basically the resolution determined by the Project Settings - 1920x1080. By default, it resizes it by stretching it out in the width. Now, part of the image might be cut off that way, but you can also select some different options for resize type. For example, you can choose to distort it, which distorts the image, so all 4 corners match the proper resolution.
We are now ready to move on to animation.