5.2. 路径属性

路径,像图层和通道一样,是图像的组成部分。当图像以GIMP的原生 XCF 文件格式保存时,它具有的任何路径都与它一起保存。可以使用路径对话框查看和操作图像中的路径列表。您可以通过使用路径对话框中的弹出菜单进行复制和粘贴,或把图标从路径对话框拖到目标图像窗口中,将路径从一个图像移动到另一个图像。

GIMP路径属于一种称为“贝塞尔路径”的数学类型。这实际上意味着它们是由锚点手柄定义的。“锚点”是路径经过的点。“手柄”定义了路径进入或离开锚点时的方向:每个锚点都有两个手柄附加其上。

Paths can be very complex. If you create them by hand using the Paths tool, they probably won’t contain more than a few dozen anchor points and usually a less than that. However, if you create them by transforming a selection into a path, or by transforming text into a path, the result can easily contain hundreds or even thousands of anchor points.

一个路径可能包含多个组件。“组件”是锚定点由路径段相互连接的路径的一部分。路径中有多个组件的能力允许您将它们转换为具有多个不联通的部分的选区。

路径的每个组件都可以是开放的封闭的:“封闭”意味着最后一个锚点连接到第一个锚点。如果将路径转换为选区,则通过使用直线将最后一个锚点连接到第一个锚点,任何开放的组件都会自动转换为封闭的组件。

Path segments can be either straight or curved. A path is called “polygonal” if all of its segments are straight. A new path segment is always created straight; the handles for the anchor points are directly on top of the anchor points, yielding handles of zero length, which produces straight-line segments. Drag a handle away from an anchor point to cause a segment to curve.

One nice thing about paths is that they use very few resources, especially in comparison with images. Representing a path in RAM requires storing only the coordinates of its anchors and handles. Therefore, it is possible to have literally hundreds of paths in an image without causing any significant stress to your system. Even a path with thousands of segments consumes minimal resources in comparison to a typical layer or channel.

Paths can be created and manipulated using the Paths tool.