psd_tools.psd.vector

Vector mask, path, and stroke structure.

Path

class psd_tools.psd.vector.Path(items=_Nothing.NOTHING)[source]

List-like Path structure. Elements are either PathFillRule, InitialFillRule, ClipboardRecord, ClosedPath, or OpenPath.

Subpath

class psd_tools.psd.vector.Subpath(items=_Nothing.NOTHING, operation: int = 1, unknown1: int = 1, unknown2: int = 0, index: int = 0, unknown3: bytes = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')[source]

Subpath element. This is a list of Knot objects.

Note

There are undocumented data associated with this structure.

operation

int value indicating how multiple subpath should be combined:

1: Or (union), 2: Not-Or, 3: And (intersect), 0: Xor (exclude)

The first path element is applied to the background surface. Intersection does not have strokes.

index

int index that specifies corresponding origination object.

is_closed()[source]

Returns whether if the path is closed or not.

Returns:

bool.

Knot

class psd_tools.psd.vector.Knot(preceding: tuple = (0.0, 0.0), anchor: tuple = (0.0, 0.0), leaving: tuple = (0.0, 0.0))[source]

Knot element consisting of 3 control points for Bezier curves.

preceding

(y, x) tuple of preceding control point in relative coordinates.

anchor

(y, x) tuple of anchor point in relative coordinates.

leaving

(y, x) tuple of leaving control point in relative coordinates.

ClipboardRecord

class psd_tools.psd.vector.ClipboardRecord(top: int = 0, left: int = 0, bottom: int = 0, right: int = 0, resolution: int = 0)[source]

Clipboard record.

top

Top position in int

left

Left position in int

bottom

Bottom position in int

right

Right position in int

resolution

Resolution in int

PathFillRule

class psd_tools.psd.vector.PathFillRule[source]

Path fill rule record, empty.

InitialFillRule

class psd_tools.psd.vector.InitialFillRule(value=0)[source]

Initial fill rule record.

rule

A value of 1 means that the fill starts with all pixels. The value will be either 0 or 1.

VectorMaskSetting

class psd_tools.psd.vector.VectorMaskSetting(version: int = 3, flags: int = 0, path=None)[source]

VectorMaskSetting structure.

version
path

List of Subpath objects.

property disable

Flag to indicate that the vector mask is disabled.

property invert

Flag to indicate that the vector mask is inverted.

Flag to indicate that the vector mask is not linked.

VectorStrokeContentSetting

class psd_tools.psd.vector.VectorStrokeContentSetting(items=_Nothing.NOTHING, name: str = '', classID=b'null', key: bytes = b'\x00\x00\x00\x00', version: int = 1)[source]

Dict-like Descriptor-based structure. See Descriptor.

key
version