About Input and Output of Images |
Shake can read in and write out a variety of image file formats. These formats all assume one image file per frame. Streaming formats such as QuickTime are also available, but only on Mac OSX.
These individual images can be numbered with padding (0001, 0002, etc.) or without padding (1, 2, etc.), with a file extension or without one. If Shake is unable to find a frame, it assumes you are using a 720x486 black frame (by default) and continues the composite with that instead.
It's good practice to include the file extension (i.e., .iff, .cin, .tif, etc.), but Shake doesn't necessarily need them. In general, you use the extension to define the input or output format, but you can also explicitly set it to a certain type if your files aren't using extensions.
Shake is a hybrid renderer it adapts its rendering from either scan-lines or a group of tiles. This means it never has to load the entire image, just a single piece from it, making a much smaller memory footprint than other compositors. Sometimes you cannot load just a single line, for example during a Rotate, in which case Shake internally breaks the image down into small tiles to work with more manageable bits.
For a complete list of file formats and their characteristics, jump to Supported
File Formats. Also, see below for a discussion on temporary
disk space used by Shake when reading certain file types.
Images are usually read into Shake with the Image - FileIn function. Importing images is therefore like any other function as the node appears in the node tree.
Shake also includes many image generation tools to create circles, gradations, text, shapes, etc., so you don't need to go to an outside package to generate them.
To save an image, attach a FileOut node to the image you want to write to disk. You can have unlimited FileOuts that can be placed anywhere along the node tree. Therefore, you can have outputs of different resolutions, bit depths, or color spaces. For example, you can simultaneously write a 10-bit 2K log Cineon image and an 8-bit video resolution linear gamma-adjusted frame for a video preview of your composite before the filmout images get back from a film processing lab.
If you write an image without an extension (i.e., image_name instead of image_name.cin), and you haven't explicitly set an output format, Shake writes the image to its native .iff format.
For the batch system, you can use the -fileout option, or the abbreviation -fo to write your image. For example,
shake my_image.cin -fo my_image.iff
copies my_image.cin as a new image file in .iff format.
The Interface allows you to view frames anywhere along the node tree by having multiple Viewers. In the script or the command-line mode however, you may need to explicitly call intermediate nodes with either -view or -monitor. For example,
shake my_image.rla -rotate 45 -view -flop
shows two viewers, one of the image rotated 45 degrees, and the second rotated and flopped over.
If you append a .gz to the end of the filename, Shake also further compresses the file. Shake recognizes the file format and all of its channels when either reading or writing one of these images:
shake uboat.iff -fo uboat.iff.gz
This further compresses uboat.iff, maintains it in .iff format, and
keeps the Z channel.
You can refer to an image sequence by replacing the frame number with a # sign or an @ sign. The # sign signifies a 4-place padded number, and the @ sign signifies an unpadded number. You can also use several @ signs to indicate padding to a different number, (for example, @@@ signifies 001).
Here are some formatting examples:
Shake format | Reads/Writes... |
image.#.iff | image.0001.iff, image.0002.iff |
image.%04d.iff | image.0001.iff, image.0002.iff |
image.@.iff | image.1.iff, image.2.iff |
image.%d.iff | image.1.iff, image.2.iff |
image.@@@.iff | image.001.iff, image.002.iff |
image.%03d.iff |
image.001.iff, image.002.iff |
These assume an exact relation between the current frame processed in Shake, and the frame being read in. For example, at frame 1, image.1 is read in. If you are reading the images in from the GUI with Sequence Listing activated in the Browser, you see the actual sequence in the fileName field. For example,
Image | Shake Syntax with Sequence Listing |
image.4.iff, image.5.iff ... image.10.iff | image.4-10@.iff |
image.4, image.5.iff, image.6.iff, image.10.iff | image.4-6,10@.iff |
Unlike the previous examples, these offset the clip timing by placing image.4.iff at frame 1 and image.5.iff at frame 2. In the first example, image.10.iff is placed at 7. In the second example, image.10.iff is placed at frame 5. All sequence gaps are ignored. Offset or retime a clip by either using the Timing sub-tab in the FileIn parameters or the Time View tab.
For more information on handling time, see About
Time.
Shake can read either local or absolute file paths. For example, take a directory structure like this, with a machine named Biggo:
/shots/pix/my_image.iff
/shots/scr/my_script.shk
The script can access my_image.iff in the following ways:
FileIn1 = FileIn("../pix/my_image.iff");
FileIn2 = FileIn("/shots/pix/my_image.iff");
FileIn3 = FileIn("//Biggo/shots/pix/my_image.iff");
Local file paths in a script are local to where the script is located, not from where Shake is called.
Shake converts the file path of an image to the UNC naming convention when it reads in an image. This labels the machine name first, and then the file path. The third listing above is an example of this convention. This behavior can be turned off in a preferences file. See Customizing Shake for more information.
If the script and the image are on different disks, you will of course have
to specify the proper disk local file paths won't work..
Shake creates temporary files ("tmp files") when writing certain formats of images, or when running out of memory. These temporary files are written like swap files, but are used before onerous activity occurs, thereby saving your machine from the crush of swapping. Normally, Shake reads in only the portion, either a group of scanlines or a tile of the image, that it can fit into memory. This means that the image is read not once, but rather many times, with only a bit read each time. Additionally, only the contributing portion of the image is loaded in. The ideal format to support this behavior is Shake's native .iff format, which is also the format licensed to Alias/Wavefront for their Maya software. Certain other formats, however, do not support the ability to efficiently read a random portion of the image, and can take significantly longer to load.
These create temporary files | These do NOT create temporary files |
Alias | AVI |
BMP (depending on orientation) | DXP |
Cineon (depending on orientation) | GIF |
JPEG | IFF |
PBM | Mental Images |
Softimage | .MOV/QuickTime |
Targa (depending on orientation) | PNG |
TIF (depending on orientation) |
RLA |
YUV | SGI |
Side FX |
Use this formula to calculate the maximum temp space needed during I/O:
tmp file = width*height*number_of_channels*bytes,
where bytes = 1 for 8 bit, 2 for 10 or 16 bits, 4 for float.
Additionally, certain nodes also create tmp files during processing. This is required when pixels drastically change their x, y position during rendering. For example, if you rotate an image 90 degrees, the pixel in the lower right now moves to the upper right. In order to process this, Shake creates a tmp file that includes as much information as necessary to calculate the image. A tiling system is used so these tmp files are typically much smaller than those created during I/O. The nodes prone to this behavior are:
By default, your temporary files are written to:
/var/tmp
To relocate the temporary directory, set the environment variable TMPDIR:
setenv TMPDIR /more_disk_space/tmp