Rectangle

Generates a rectangle in a solid color on top of the input image.

Inputs and Controls

Connection Type

Connection Name

Function

Input

unnamed

The image sequence to which the rectangle is added.

mask

An optional image to use as a mask. By default, the rectangle is limited to the non-black areas of the mask.

At first, the mask input appears as triangle on the right side of the node, but when you drag it, it turns into an arrow labeled mask. If you cannot see the mask input, ensure that the mask control is disabled or set to none.

Control (UI)

Knob (Scripting)

Default Value

Function

Rectangle Tab

output

output

rgba

The rectangle is rendered into these output channels.

If you set this to something other than none, you can use the checkboxes on the right to select individual channels.

premult

premult

none

Premultiply multiplies the chosen input channels with a mask representing the rectangle. For example, where there is no rectangle (the matte is black or empty), the input channels are set to black. Where the rectangle is opaque (the matte is white or full), the input channels keep their full value.

Note:  Selecting rgba premultiplies the alpha against itself (a*a). If you don’t want this to happen, set premult to rgb instead.

clip to

cliptype

format

Select how to restrict the output image:

no clip - use the entire image.

bbox - restrict the output image to the incoming bounding box.

format - restrict the output image to the incoming format area.

unionbboxandformat - restrict the output image to a combination of the incoming bounding box and format area.

intersectbboxandformat - restrict the output image to an intersection of the bounding box and incoming format area.

replace

replace

disabled

When enabled, existing channels are cleared to black before drawing into them. You might find replace useful, for instance, if you’re creating a mask in the alpha channel, but the incoming image already has an alpha channel which you want to throw away.

invert

invert

disabled

When enabled, inverts the new rectangle and non-rectangle areas.

opacity

opacity

1

Sets the rectangle opacity where 0 is equal to transparent, and 1 is equal to opaque.

mask

N/A

disabled

Enables the associated mask channel to the right. Disabling this checkbox is the same as setting the channel to none.

maskChannelInput

none

The channel to use as a mask. By default, the rectangle is limited to the non-black areas of this channel.

inject

inject

disabled

Copies the mask input to the predefined mask.a channel. Injecting the mask allows you to use the same mask further downstream.

invert

invert_mask

disabled

Inverts the use of the mask channel so that the rectangle is limited to the non-white areas of the mask.

area xyrt (xywh)

area

N/A

Sets the area of the rectangle.

softness

softness

1

Sets the softness of the rectangle edges where 0 is a hard edge.

Color Tab

ramp

ramp

none

Selects whether to create a color gradient across the rectangle:

none - don’t create a color gradient.

linear - the ramp changes linearly from one color into another.

smooth0 - the ramp color gradually eases into the point 0 end. This means colors in the point 0 end are spread wider than colors in the point 1 end.

smooth1 - the ramp color eases into the point 1 end. This means colors in the point 1 end are spread wider than colors in the point 0 end.

smooth - the ramp color gradually eases into both ends. This means colors in the point 0 and point 1 ends are spread wider than colors in the center of the ramp.

color

color

1

Sets a color for the ramp.

If ramp is set to anything other than none, this is the color for the ramp at the point 1 end (by default, the top end).

point 1 xy

p1

100, 400

Sets the position of point 1. This allows you to adjust the spread and angle of the ramp.

This control is only available if ramp is set to anything other than none.

color 0

color0

0

Sets the color for the ramp at the point 0 end (by default, the bottom end).

This control is only available if ramp is set to anything other than none.

point 0 xy

p0

100, 100

Sets the position of point 0. This allows you to adjust the spread and angle of the ramp.

This control is only available if ramp is set to anything other than none.