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 like QuickTime will be available in future versions. These images can be numbered with padding (0001, 0002, etc) or without padding (1, 2, etc), with a file extension or without one. If Shake cannot find a frame, it will assume you are using a 720x486 black frame and continue the composite with that instead.
It's good practice to include the file extension (i.e., .iff, .cin, .tif, etc), so that anybody seeing the file can get an idea of it's file type, but Shake doesn't necessarily need them. Generally speaking, 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 what is called a hybrid renderer, meaning it adapts its rendering from either scan-lines or a group of tiles. This means it never has to load up the entire image, just a single piece from it, making a much smaller memory footprint than other compositors. Sometimes you can't load up just a single line, for example during a Rotate, in which case Shake breaks the image down into tiles to work with more manageable bits.
For a complete listing 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 read into Shake generally with the FileIn command, but you can also use PullDown or Pullup if you are doing conversion between film and video speeds. You can also use the Average function, which will either expand or compress images into a different frame range. For example, if you have 120 images (four seconds of video), you can squeeze them into 30 frames, lasting one second. This means that 4 frames are being faded together to get a sort of motion blur effect.
Shake also includes many image generation tools to create circles, text, grids, etc, so you don't need to go to an outside package to generate them.
To save an image, you use the FileOut function and attach it to whatever image you want to go out. You can have as many FileOuts as you want, and they can be placed anywhere along the compositing tree. Because of this, you can have outputs of different resolutions, bit-depths, or color-spaces. For example, you can have a 16-bit 2k log Cineon image being written as well as an 8-bit video-res linear gamma-adjusted frame straight to an Accom so you can see your composite on video 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 it to Nothing Real's 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
will copy my_image.cin as a new image file in .iff format.
The Interface allows you to view frames anywhere along the compositing tree by having multiple Viewers. However in the script or the command-line mode, you may need to explicitly call intermediate nodes with either -view or -monitor. For example,
shake my_image.rla -rotate 45 -view -flop
will show you two viewers, one of the image rotated 45 degrees, and the second is rotated and flopped over.
If you append a .gz to the end of the filename, Shake will additionally do a compression on the file. Shake can still recognize 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 will compress uboat.iff down further still, maintain it in .iff
format, and also keep the Z channel.
You can refer to an image sequence by replacing the frame number with a # sign or a @ sign. The # sign signifies a 4-place padded number, and the @ sign signifies an unpadded number. You may also use several @ signs to indicated padding to a different number, for example, 001 would be @@@. Here are some 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 that there is an exact relation between the current frame processed in Shake, and the frame being read in, i.e., at frame 1, image.1 is being read in. If you are reading the images in from the GUI with Sequence Listing, you will 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, this will 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 goes to frame 7, and frame 4 in the second example. All sequence gaps are ignored. You may also offset the clip with various Time functions after reading the clip in.
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 where Shake is called from.
When Shake reads an image into the GUI, the file path is converted to the UNC naming convention of placing the machine name first, and then the path. This can be turned off in a preferences file. See Customizing Shake for more information.
For NT systems, you can use either \ or / for your directory breaks. You can also optionally use the disk in the name if you want. For example, assuming the image and the script are on a D drive (for NT), these are all equivalent:
FileIn4 = FileIn("/shots/pix/my_image.iff"); FileIn5 = FileIn("D:/shots/pix/my_image.iff"); FileIn6 = FileIn("//Biggo/D/shots/pix/my_image.iff");
If the script and the image are on different disks, you will of course have
to specify the proper disk.
Shake will create temporary files ("tmp files") when writing certain formats of images, or when running out of memory. These temporary files are written like swap files are, but are used before swap activity occurs, thereby saving your machine from the crush of swapping. Normally, Shake will read in only the portion, either a group of scanlines or a tile of the image, that it feels 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. 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 |
Tiff (depending on orientation) |
Rla |
Yuv | Sgi |
Side FX |
To calculate the maximum temp space needed during I/O, you can use this formula:
temp file = width*height*number_of_channels*bytes,
where bytes = 1 for 8 bit, 2 for 10 or 16 bits.
Additionally, there are certain nodes which also create temp files during processing. This is required when pixels drastically change their x,y position during processing. 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 will create a tmp file including as much information as necessary to process the image. We use a tiling system for this so these tmp files are typically much smaller than those created during I/O. The nodes that are prone to this behavior are:
By default, your temporary files are written to:
IRIX: /var/tmp
NT: System temp directory.
To relocate the temporary directory, set the environment variable TMPDIR, i.e.,
setenv TMPDIR /more_disk_space/tmp
or, in NT, by clicking the right mouse on My Computer and selecting Environment.