perspective

Last update: 2023-08-31
  • Created for:
  • Developer
    User

Perspective transform. Apply a perspective transform to the layer source image so it fills the region specified with the quadrilateral. Other areas of the layer remain transparent.

perspective= *perspQuad*[, *resOptions*]

perspectiveN= *perspQuadN*[, *resOptions*]

perspQuad

Perspective quadrilateral pixel coordinates (8 reals, separated by commas).

perspQuadN

Perspective quadrilateral normalized coordinates (8 reals, separated by commas).

resOptions

Resampling options (see below).

The modifier perspQuad consists of four pixel coordinate values in the composite (or layer 0) coordinate space, which originates at the top-left corner of the composite image.

The modifier perspQuadN consists of four normalized coordinate values, where 0.0,0.0 corresponds to the top-left corner of the composite/layer 0 image and 1.0,1.0 to the bottom-right corner.

The input image is transformed so that the top-left corner of the input image maps to the first coordinate value of perspQuad[N], the top-right corner to the second coordinate, the bottom-right corner to the third coordinate, and the bottom-left corner to the fourth coordinate.

NOTE

The modifier pos= can be used to further position the transformed layer in the composite image.

The perspective quadrilateral coordinates may be located outside the composite image.

Behavior is undefined if the quadrilateral is not suitable for a perspective transform. For example, if two or more vertices coincide, if three or all vertices are on the same line, or if the quadrilateral is self-intersecting or concave.

Quality considerations

While the default implementation produces a reasonable compromise between quality and performance, it may be necessary to increase the resolution of the source image to improve sharpness or to reduce it to reduce aliasing artifacts.

If the source is an image, use scale= to choose a different resolution (relative to the full resolution of the image). The specified scale= value is rounded to the next higher PTIF resolution level. If there is a nested request source, the size of the image produced by the nested request can be adjusted to achieve the desired sharpness. For text layers, the resolution of the input image (the rendered text) is adjusted by selecting a larger size= value with increasing the resolution specified with textAttr=.

The modifier resOptions lets you select an alternative resampling algorithm. The following values are supported (case-sensitive):

Value Description

R1

Nearest neighbor.

R2

Bi-linear.

R3

Standard super-sampling (default).

R3T n

Super-sampling with adjustable jitter ( n must be an integer value from 0 through 200).

Properties

Layer command. Applies to the current layer or to layer 0 if layer=comp. Ignored by effect layers.

The modifier res= is always ignored when perspective is present in the same layer. The modifier size= is ignored when specified for image layers. The modifiers size= and res= in layers with perspective= are reserved for future use.

Default

None, for no perspective transform.

See also

size= , scale=, pos=, textAttr=

On this page