Compositing Images

 
 
 

The composite standalone composites many images into one.

When compositing sequences, you can add a single still frame as a layer by appending the extension .0 (zero) to the layer name.

For field-rendered image sequences, you can composite the odd-field or even-field dominated image, or both. For example, to composite the even-field image, you would type:

composite output -E

where output is your rendered image.

Usage

composite [-a] [-b <red> <green> <blue>][-S <width> <height>] [-p <pixel ratio>] <output file>[-r <repeat count>][-s <start frame> <end frame> <step>] [-d] [-v] [-Z][-F|-E|-O] { <layer> [<start frame>] [-F|-E|-O][-c|-o|-f <fact>
[-e <end fact>] | -h <radius> <fact>|-B|-C|-D|-N|-P] [-x <xoff>]
[-y <yoff>] | [-X <end xoff>] [-Y <end yoff>] ...}

Where <output file> is the name you want to give to the final picture and <layer> is the name of a layer to add to the final image. Use the corresponding <start frame> to specify the starting frame of the <layer> sequence.

NoteWhen compositing sequences, you can add a single still frame as a layer by appending the extension .0 (zero) to the layer name.

Options

-a

Omits the alpha channel in the output. By default, the alpha channel is included in the output.

-b

Sets the background color (default values: 0.0, 0.0, 0.0). Each color value must be in the range [0, 1].

-S

Specifies the size of the output file. The default is the size of the first layer. If the first layer is a subregion rendering, the default is the full image resolution.

-p

Specifies the output picture pixel ratio.

-r

Specifies how many times each frame should be repeated. The default is 1.

-s

Composites a sequence of frames.

-d

Displays the result on screen.

-v

Turns on the verbose mode.

-Z

Uses the Z channel for compositing.

To use this option, you must render each sequence using the Z channel and have a corresponding .Zpic file for each layer. Do not type the extension at the end of the layer name.

In addition, you must specify the -c option for all layers that you want to composite.

-F

Specifies full frame images. This is the default.

-E

Specifies field images with even field dominance.

-O

Specifies field images with odd field dominance.

-c

Composites this layer. This is the default for all layers after the first, unless the -Z option is specified.

-o

Overlaps this layer. This is the default for the first layer.

-f

Fades this layer, and specifies an initial fading factor.

-e

Varies the fading factor continuously from frame to frame. You must specify the fading factor for the final frame.

-h

Creates a halo on the foreground where its contour pixels are more intense than their adjacent background pixels.

<radius> is the width of the halo.

<fact> is the blending factor which determines the strength of the halo effect.

-B

Blends the layer's intensity with the background's intensity, according to the layer's alpha channel.

-C

Composites the layer with the background by taking the brightest of the corresponding pixels.

-D

Generates the difference between the layer and the background.

-N

Composites the background and the layer as if two superimposed negatives were printed.

-P

Composites the background and the layer as if they were two superimposed slides.

-x

Offsets the picture from the left of the screen by the amount specified in pixels. A negative pixel value offsets the picture from the right.

-y

Offsets the picture from the bottom of the screen by the amount specified in pixels. A negative pixel value offsets the picture from the top.

-X

Picture translation in pixels from the left of the screen (the default is zero). A negative pixel value translates the picture from the right.

-Y

Picture translation in pixels from the bottom of the screen (the default is zero). A negative pixel value translates the picture from the top.

Examples

The following example simply merges two layers to give a straightforward composite. The result is called imageA. The background image is imageB.1 and the foreground image is imageC.1. The -v option displays information while the standalone is running.

composite imageA imageB.1 imageC.1 -v

The following example composites two sequences of field images with even field dominance:

composite output -s 1 10 1 -E layer1 -E layer2 -E

The following example composites background and foreground as if they were two superimposed slides, saving the result as finalimage.

composite finalimage background foreground -P

The following example shows how to crop 100 pixels from the edges of a 1000 ° 1000 pixel image, leaving the center at 800 ° 800 pixels.

composite -S 800 800 output input -x 100 -y 100

The following example fades from scene_1 to scene_2 for 100 frames. The mix begins with frame 500 of scene_1 and frame 1 of scene_2.

composite output -s 1 100 1 scene_1 500 scene_2 1 -f 0 -e 1

The following example composites two image files (tore.pic and cone.pic) using information in the Z channels (-Z). It offsets the first layer by 100 pixels from the left and 100 pixels from the bottom, and offsets the second layer by 50 pixels from the left and 50 pixels from the bottom. It also displays verbose messages (-v) while running.

composite result -Z tore -c -x 100 -y 100 cone -c -x 50 -y 50 -v

The following example composites two sequences of images (spin1 and spin2) with a step of 2; this means that images spin1.1.pic, spin1.3.pic, etc., is used. The result is a sequence of images named res.1.pic, res.3.pic, etc. The other options specify to use Z channels (-Z), to run in verbose mode (-v), and to display the final image.

composite res -d -Z -s 1 25 2 spin1 -c spin2 -c -v

The following example composites imageB.1 onto a white background in video size. The new image is called imageA. The -c option is needed because the first layer is not composited by default.

composite -S 720 486 -b 1 1 1 imageA imageB.1 -c -v

The following example crops a full 720 ° 486 ° 0.9 image (logo.1) to a 720 ° 60 x 0.9 image, and writes this to a file called logo.final.

composite -S 720 60 logo.final logo.1

The following example composites logo.shadow and logo.original, and creates logo.final.

  • The option -b 1 1 1 colors the background white.

  • The layer logo.shadow is composited using the -c option to force use of the alpha channel over the colored background.

  • The -x and -y parameters specify offsets for logo.shadow.

  • The layer logo.original does not require the -c option because it is the second layer specified and is therefore composited by default.

composite -b 1 1 1 logo.final logo.shadow -c -x 2 -y -2 logo.original

The following examples show the appropriate parameters for cropping imageA.1 to the appropriate size for the safe title area at different resolutions.

composite -S 1024 70 logo1k imageA.1
composite -S 2048 140 logo2k imageA.1
composite -S 4096 280 logo4k imageA.1
composite -S 6144 420 logo6k imageA.1
composite -S 8192 560 logo8k imageA.1

Viewing and Compositing Field Images

You can use composite to view and composite field-rendered pictures and sequences. For example, the following command composites two sequences of field images:

composite output -s 1 10 1 -E layer1 -E layer2 -E

The output of this command is also a sequence of field images — you can view the output sequence using the flipbook standalone:

flipbook output 1 -E

To view the first image in the sequence, use the showpic or display standalone:

showpic output.1 -E
display output.1 -E