File: ch02s04s07.html

package info (click to toggle)
gimp-help 2%2B0.7-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 30,852 kB
  • ctags: 4
  • sloc: xml: 104,248; sh: 544; makefile: 262; perl: 42
file content (386 lines) | stat: -rw-r--r-- 16,507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>4.7. Paths</title>
    <link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
    <link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.66.1" />
    <link rel="start" href="index.html" title="&#10;      &#10;    " />
    <link rel="up" href="ch02s04.html" title="4. Working with Images" />
    <link rel="prev" href="ch02s04s06.html" title="4.6. Grids and Guides" />
    <link rel="next" href="ch02s04s08.html" title="4.8. Brushes" />
  </head>
  <body>
    <div xmlns="" class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center" id="chaptername">4.7. Paths</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="ch02s04s06.html">Prev</a> </td>
          <th width="60%" align="center" id="sectionname">4.7. Paths</th>
          <td width="20%" align="right"> <a accesskey="n" href="ch02s04s08.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect2" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h3 class="title"><a id="gimp-paths"></a>4.7. Paths</h3>
          </div>
        </div>
      </div>
      <a id="id3309534" class="indexterm"></a>
      <div class="informalfigure">
        <div class="mediaobject">
          <img src="../images/using/path-examples.png" />
          <div class="caption">
            <p>
           Four examples of GIMP paths: one closed and polygonal; one
           open and polygonal; one closed and curved; one with a mixture
           of straight and curved segments.
        </p>
          </div>
        </div>
      </div>
      <p>
    A <span class="emphasis"><em>path</em></span> is a one-dimensional curve.  Paths are
    used for two main purposes:
  </p>
      <div class="itemizedlist">
        <ul type="disc">
          <li>
            <p>
        A closed path can be converted into a selection.
      </p>
          </li>
          <li>
            <p>
        An open or closed path can be <span class="emphasis"><em>stroked</em></span>,
        that is, painted on the image, in a variety of ways.
      </p>
          </li>
        </ul>
      </div>
      <p>
    Paths can be created and manipulated using the <a href="ch03s06.html#gimp-tool-path" title="6.1. Path Tool">Path tool</a>.  Paths, like layers and
    channels, are components of an image.  When an image is saved in
    GIMP's native XCF file format, any paths it has are saved along
    with it.  The list of paths in an image can be viewed and operated
    on using the <a href="ch04s04.html" title="4. Path dialog">Paths
    dialog</a>.  If you want to move a path from one image to
    another, you can do so by copying and pasting using the popup menu
    in the Paths dialog, or by dragging an icon from the Paths dialog
    into the destination image's window.
  </p>
      <div class="informalfigure">
        <div class="mediaobject">
          <img src="../images/using/path-with-anchors.png" />
          <div class="caption">
            <p>
           Appearance of a path while it is being manipulated using the
           Path tool.  Black squares are anchor points, the open circle
           is the selected anchor, and the two open squares are its
           handles.  Note that this path has two components.
        </p>
          </div>
        </div>
      </div>
      <p>
    GIMP paths belong to a mathematical type called "Bezier paths".
    What this means in practical terms is that they are defined by
    <span class="emphasis"><em>anchors</em></span> and <span class="emphasis"><em>handles</em></span>.
    "Anchors" are points the path goes through.  "Handles" define the
    direction of a path when it enters or leaves an anchor point:
    each anchor point has two handles attached to it.  
  </p>
      <p>
    Paths can be very complex.  If you create them by hand using the
    Path tool, unless you are obsessive they probably won't contain
    more than a few dozen anchor points (often many fewer); but if you
    create them by transforming a selection into a path, or by
    transforming text into a path, the result can easily contain
    hundreds of anchor points, or even thousands.
  </p>
      <p>
    A path may contain multiple <span class="emphasis"><em>components</em></span>.  A
    "component" is a part of a path whose anchor points are all
    connected to each other by path segments.  The ability to have
    multiple components in paths allows you to convert them into
    selections having multiple disconnected parts.
  </p>
      <p>
    Each component of a path can be either <span class="emphasis"><em>open</em></span>
    or <span class="emphasis"><em>closed</em></span>: "closed" means that the last
    anchor point is connected to the first anchor point.  If you
    transform a path into a selection, any open components are
    automatically converted into closed components by connecting the
    last anchor point to the first anchor point with a straight line.
  </p>
      <p>
    Path segments can be either straight or curved.  A path all of
    whose segments are straight is called "polygonal".  When you
    create a path segment, it starts out straight, because the handles
    for the anchor points are intially placed directly on top of the
    anchor points, yielding handles of zero length, which produce
    straight-line segments.  You can make a segment curved by dragging
    a handle away from one of the anchor points.
  </p>
      <p>
    One nice thing about paths is that they are very light in terms of
    resource consumption, especially in comparison with images.
    Representing a path in RAM only requires storing the
    coordinates of its anchors and handles:  1K of memory is enough to
    hold quite a complex path, but not enough to hold even a 20x20
    pixel RGB layer.  Therefore, it is quite possible to have
    literally hundreds of paths in an image without putting any
    signficant stress of your system.  (How much stress managing them
    would put on <span class="emphasis"><em>you</em></span> is, of course, another
    question.)  Even a path with thousands of segments consumes
    minimal resources in comparison to a typical layer or channel.
  </p>
      <div class="simplesect" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h4 class="title"><a id="id3310390"></a>Paths and Selections</h4>
            </div>
          </div>
        </div>
        <p>
      GIMP lets you transform the selection for an image into a path;
      it also lets you transform paths into selections.  For
      information about the selection and how it works, see the <a href="ch02s04s04.html" title="4.4. The Selection">Selection</a> section.
    </p>
        <p>
      When you transform a selection into a path, the path closely
      follows the "marching ants".  Now, the selection is a
      two-dimensional entity, but a path is a one-dimensional entity,
      so there is no way to transform the selection into a path
      without losing information.  In fact, any information about
      partially selected areas (i.e., feathering) will be lost when
      the selection is turned into a path.  If the path is transformed
      back into a selection, the result is an all-or-none selection,
      similar to what would be obtained by executing "Sharpen" from
      the Select menu.
    </p>
      </div>
      <div class="simplesect" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h4 class="title"><a id="id3310812"></a>Stroking a Path</h4>
            </div>
          </div>
        </div>
        <div class="informalfigure">
          <div class="mediaobject">
            <img src="../images/using/path-stroking-examples.png" />
            <div class="caption">
              <p>
             The four paths from the top illustration, each stroked in a
             different way.
          </p>
            </div>
          </div>
        </div>
        <p>
      Paths do not alter the appearance of the image pixel data unless
      they are <span class="emphasis"><em>stroked</em></span>, using
      <span class="guimenu">Edit</span>-&gt;<span class="guimenuitem">Stroke Path</span>
      from the image menu or the Paths dialog right-click menu, or the
      "Stroke Path" button in the Tool Options dialog for the Path
      tool.  
    </p>
        <p>
      Choosing "Stroke Path" by any of these means brings up a dialog
      that allows you to control the way the stroking is done.  You
      can choose from a wide variety of line styles, or you can stroke
      with any of the Paint tools, including unusual ones such as the
      Clone tool, Smudge tool, Eraser, etc.
    </p>
        <p>
      You can further increase the range of stroking effects by
      stroking a path multiple times, or by using lines or brushes of different
      widths.  The possibilities for getting interesting effects in
      this way are almost unlimited.
    </p>
      </div>
      <div class="simplesect" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h4 class="title"><a id="id3310885"></a>Transforming Paths</h4>
            </div>
          </div>
        </div>
        <p>
      Each of the Transform tools (Rotate, Scale, Perspective, etc)
      can be set to act specifically on paths, using the "Affect:"
      option in the tool's Tool Options dialog.  This gives you a
      powerful set of methods for altering the shapes of paths without
      affecting other elements of the image.
    </p>
        <p>
      By default a Transform tool, when it is set to affect paths,
      only acts on a single path:  the <span class="emphasis"><em>active
      path</em></span> for the image, which is shown highlighted in the
      Paths dialog.  You can make a transformation affect more than
      one path, and possibly other things as well, using the
      "transform lock" buttons in the Paths dialog.  Not only paths,
      but also layers and channels, can be transform-locked.  If you
      transform one element that is transform-locked, all others will
      be transformed in the same way.  So, for example, if you want to
      scale a layer and a path by the same amount, click the
      transform-lock buttons so that "chain" symbols appear next to
      the layer in the Layers dialog, and the path in the Paths
      dialog; then use the Scale tool on either the layer or the path,
      and the other will automatically follow.  
    </p>
      </div>
      <div class="simplesect" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h4 class="title"><a id="id3310826"></a>Paths and Text</h4>
            </div>
          </div>
        </div>
        <div class="informalfigure">
          <div class="mediaobject">
            <img src="../images/using/path-from-text.png" />
            <div class="caption">
              <p>
            Text converted to a path and then transformed using the
            Perspective tool.
          </p>
            </div>
          </div>
        </div>
        <div class="informalfigure">
          <div class="mediaobject">
            <img src="../images/using/path-text-stroked.png" />
            <div class="caption">
              <p>
           The path shown above, stroked with a fuzzy brush and then
           gradient-mapped using the Gradient Map filter with the
           "Yellow Contrast" gradient.
          </p>
            </div>
          </div>
        </div>
        <p>
      A text item created using the Text tool can be transformed into
      a path using the "Create path from text" button in the Tool
      Options for the Text tool.  This can be useful for several
      purposes, including:
    </p>
        <div class="itemizedlist">
          <ul type="disc">
            <li>
              <p>
          Stroking the path, which gives you many possibilities for
          fancy text.
        </p>
            </li>
            <li>
              <p>
          More importantly, transforming the text.  Converting text
          into a path, then transforming the path, and finally either
          stroking the path or converting it to a selection and
          filling it, often leads to much higher-quality results than
          rendering the text as a layer and transforming the pixel
          data. 
        </p>
            </li>
          </ul>
        </div>
      </div>
      <div class="simplesect" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h4 class="title"><a id="id3310870"></a>Paths and SVG files</h4>
            </div>
          </div>
        </div>
        <p>
      SVG, standing for "Scalable Vector Graphics", is an increasingly
      popular file format for <span class="emphasis"><em>vector graphics</em></span>, in
      which graphical elements are represented in a
      resolution-independent format, in contrast to <span class="emphasis"><em>raster
      graphics</em></span>, in which graphical elements are represented
      as arrays of pixels.  GIMP is mainly a raster graphics program,
      but paths are vector entities.
    </p>
        <p>
      Fortunately, paths are represented in SVG files in almost
      exactly the same way they are represented in GIMP.  (Actually
      fortune has nothing to do with it:  GIMP's path handling was
      rewritten for GIMP 2.0 with SVG paths in mind.)  This
      compatibility makes it possible to store GIMP paths as SVG files
      without losing any information.   You can access this capability
      in the Paths dialog.
    </p>
        <p>
      It also means that GIMP can create paths from SVG files saved in
      other programs, such as <span class="application">Inkscape</span> or
      <span class="application">Sodipodi</span>, two popular open-source
      vector graphics applications.  This is nice because those
      programs have much more powerful path-manipulation tools than
      GIMP does.  You can import a path from an SVG file using the
      Paths dialog.
    </p>
        <p>
      The SVG format handles many other graphical elements than just
      paths:  among other things, it handles figures such as squares,
      rectangles, circles, ellipses, regular polygons, etc.  GIMP 2.0
      cannot do anything with these entities, but GIMP 2.2 can load
      them as paths.
    </p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="../images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td colspan="2" align="left" valign="top">
                <p>
      Creating paths is not the only thing GIMP can do with SVG
      files.  It can also open SVG files as GIMP images, in the usual
      way. 
      </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="ch02s04s06.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="ch02s04.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="ch02s04s08.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">4.6. Grids and Guides </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> 4.8. Brushes</td>
        </tr>
      </table>
    </div>
  </body>
</html>