clipPath

Layer Clip Path. Specifies a clip path for the current layer.

clipPath=pathDefinition

clipPathE=pathName*[,pathName]

pathDefinition

Path data.

pathName

Name of path embedded in layer source image (ASCII only).

Any parts of the layer that fall outside the area defined by clipPath= are rendered transparent.

pathName is the name of a path embedded in the layer source image. The path is automatically transformed to maintain relative alignment with the image contents. If more than one pathName is specified, the server clips the image to the intersection of these paths. Any pathName not found in the source image is ignored.

Note: Only ASCII strings are supported for pathName.

pathDefinition allows specifying explicit path data in layer pixel coordinates.

If size= is specified and not 0,0, the layer is presized. In this case, path coordinates are relative to the upper-left corner of the layer rectangle and the layer is positioned based on origin= or its default. Any regions of the path outside the layer rectangle remain transparent.

If size= is not specified for a solid color or text layer, the layer is considered self-sizing with the extent of the path determining its size. If origin= is not specified, it defaults to (0,0) of the path coordinate space. This effectively allows path coordinates to be specified relative to the origin of layer 0.

Note: scale=, rotate=, and anchor= commands are not permitted for self-sizing solid color layers.

pathDefinition accepts a string similar to the value of the d= attribute of the SVG <path> element, except that commas are used instead of spaces to separate values. pathDefinition can include one or more closed-loop sub-paths.

The following path commands are supported in pathDefinition:

Command Name Description
M x,y

moveto absolute

Start a new subpath at x,y.

m x,y

moveto relative

L *{x,y}

lineto absolute

Draw a line from the current position to x,y.

l *{x,y}

lineto relative

C *{x1,y1,x2,y2,x,y}

curveto absolute

Draw a Bezier curve from the current position to x,y. x1,y1 is the control point at the beginning of the curve and x2,y2 is the control point at the end of the curve.

c *{x1,y1,x2,y2,x,y}

curveto relative

Z | z

closepath

Close the current subpath with a straight line.

Uppercase commands indicate that the coordinate values are in absolute pixel positions (relative to the upper-left of the layer rectangle). Pixel offsets follow lowercase commands relative to the current position.

'm' or 'M' always starts a new subpath. Subpaths are closed automatically (with a straight line) if 'Z' or 'z' is not specified at the end.

If a subpath begins with a relative moveto ('m'), it is relative to one of the following:

  • The starting point of the previous subpath, if it was closed with 'z' or 'Z'.

  • The end point of the previous subpath, if it was not closed explicitly.

  • 0,0, if this is the first subpath.

Properties

Layer attribute. Applies to the current layer or to the composite image if layer=comp. Effect layers ignore it.

clipPathE= is ignored if no path with the specified name is found in the layer source image, or if the layer source is not an image.

Default

None, for no additional clipping of the layer.