Gimptalk - Premier Gimp Community: Creating and Using Paths - Gimptalk - Premier Gimp Community

Jump to content

  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Creating and Using Paths

#1 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 23 July 2005 - 06:43 AM

Posted Image Posted Image

Keywords: Gimp, Paths, Selections, Text Modification, Animation

In the following series of lessons, we will be learning about the paths tool in GIMP. This lesson is dedicated to GIMPtalk.com board member, techyon, who requested help with this tool sometime back. Hopefully, his patience will be rewarded.

Lesson Prerequisites: This is a moderate-to-advanced level series of lessons. All steps to complete the examples will be given; however, the exact menu item locations and pictures may not be provided. Please forgive me, but this is a very detailed tutorial series that has taken several hours of time to research and prepare.

You should be familiar with opening projects, adding layers, changing colors, and the various selection tools. The final lesson is optional and will cover utilizing paths within the Gimp Animation Program (GAP). Again, I will discuss the steps to complete the animation examples, but should you choose to proceed through the lesson, you will need a good understanding of creating basic GAP animations.


Disclaimer: These lessons are not intended to cover every possible aspect of paths, as I'm still learning the functions myself. However, I do believe that you'll discover enough from the material to be able to incorporate paths into your GIMP creations and learn the subtleties yourself.

These lessons were prepared utilizing other web resources found here:

http://gimp-savvy.co...tml?node39.html and http://docs.gimp.org...ch02s04s07.html

As always, if you discover that I've made a mistake or am unclear about something, please let me know and I'll correct it as soon as possible. Comments and suggestions are always welcome!

Now that all the housekeeping tasks are out of the way, let's begin our first lesson on paths.

The path tool (which is also known as the Bezier path tool) is one of the most powerful selection tools in Gimp's arsenal. Like the other selection tools (ie. Elliptical, lasso, magic wand, etc.), selections created with the path tool can be stroked, filled, converted to mask, and altered by any of Gimp's filters and plugins. Additionally, selections can be converted back into paths for additional alteration (ie. Adding, moving, deleting anchors).

This is, however, where the similarities between paths and selections end.

[*]Paths are vector objects, whereas selections are raster based. Without getting into a detailed discussion of this topic, just know that vectors are made up of lines, and rasters are made up of pixels. Gimp is generally considered a raster graphics program. Vectors within Gimp cannot be modified with the various filters/plugins like layers or selections. To apply effects to a path, it first must be converted to a selection.

[*]Paths can be created in two ways: the paths tool (now I'm sure you weren't aware of that) and coverting a selection to a path.

[*]Paths do not have to be closed loops; they can be straight or curved lines. However, if you try to convert an unconnected path to a selection, Gimp will automatically connect the first and last points together. Keep that fact in mind. But remember, if you make a mistake, you can always convert a selection back to a path for modification.

[*]As stated in the last point, paths can contain curved or straight lines. A curved line segment is composed of anchor points and handles (from what I've read, this is where the term Bezier curve comes in, although a discussion of Bezier curves is beyond the scope of this lesson and very possible the author ;^) ). Anchor points are essentially where the line makes a change in direction. Handles are used to adjust the curve of the line segment entering and leaving an anchor point. For each anchor, you can have two handles, which can be adjusted at the same time or independently of each other. Straight line paths are referred to as polygonal. They have anchors and handles, but the handles are not visible or usable in the “polygonal" state. A polygonal path can be converted to a Bezier curve for alteration. When you first begin creating paths with the paths tool, the handles are hidden. One way to make them visible is to click an anchor point and without releasing the mouse button, dragging the mouse away from the anchor. The two handles are then exposed. Handles are only visible on the active or “selected" anchor. Below is an example of a path being drawn. The black circles are anchor points, the white circle is the selected anchor point, and the two, white squares are the handles.

Posted Image

[*]Unlike selections, paths can be saved with a project (xcf file). Let's say it's 1 in the morning (well, actually, it is right now for me!), and you're trying to make that perfect cutout of your favorite render to be added to a signature. You're tired and no matter how many cups of java you drink, you can't stay awake. Hey, no problems, it's a path. Save the project, go to bed, and finish editing tomorrow!

[*]Paths are like layers in the sense that you can have as many different paths as you want.

[*]Lastly, a path can be made up of disconnected segments called components. Let's say you're using an image in a presentation. In one view you want to make some pointers that point to certain parts of the image. Yet you also want to use the same image for another viewpoint, but have arrows pointing to other parts of the image. Do you have to create two separate xcf files for this project? Nope. You can use one path with multiple components for one view. Then create a new path with multiple components for the next view. Just like layers, you can turn them on and off as needed.

Are you still with me? Alright, let's do a quick lesson on the path tools. Here are the main path tool buttons and dialog boxes:

Path Tool Button
Posted Image

Path Tab in Layer Dialog Box
Posted Image

Path Tool Options Dialog Box
Posted Image

We will not be discussing the path tool options dialog box. You can play around with the various settings and discover what it can do for you. Frankly, I don't use it. From what I can tell, all the functions contained within this box, can be achieved by other means. Especially, the design, edit, and move functions, which I've outlined in the table below.

Posted Image

You may want to print this graphic out and keep it as a handy reference until you get the hang of creating and manipulating paths. Study this resource and become familiar with the various items. Of special importance are the cursors.

Now, let's create some basic paths. Remember, I will not be going into great detail on these steps. From here on out, you're on your own!

[*]Open up a new Gimp document
[*]Select the path tool
[*]Place the cursor over the document and review the cursor shape (should have a square in the corner)
[*]Now click a point and move to the next location as in my graphic. Continue to observe the cursor and refer back to my reference chart above.
[*]Add a new anchor point as I've done.
[*]When you get back to the first point you created, notice that Gimp does not know that we want to close this path. You should still see the path cursor with the little “+" sign in the corner. We want to close this path. To do that you must hold down the Ctrl key and click on the first point. Did you notice the cursor change to the path tool with an upside down “u"? If it did not, your path is not closed.

Note that the path is created entirely of straight lines. Class, what do we call a path composed of all straight lines and no handles? Polygonal.

Posted Image

Now, let's make a new path, but this time, we'll add/delete/move anchors and move the entire path.

[*]Open a new Gimp document or better yet, start a new path by clicking on the Path Tab in the Layer Dialog Box (see above graphic) and click the add new path button. Turn off the previous path you created and turn on the new one.
[*]Make a new path like before. You can close it if you want, but for my example I won't
[*]Once you're done. Pick a spot in between any two anchors that you want to add a new anchor. Hold down the Ctrl key and,if your cursor changes to the little “+" sign, click once with the mouse button. You should now have a new anchor point. Play around and add as many or as few as you want.
[*]Next, let's delete some anchors. Move your cursor over any anchor that you want to delete, hold down the Ctrl-Shft key (cursor should change to the minus symbol), click once with the mouse. Anchor should be gone!
[*]To move an individual anchor, hover over it and, if your cursor has the 4-headed arrow, click and drag the anchor around.
[*]To move the entire path, hold down the Alt key and click and drag the path to anywhere on the screen.

Posted Image

Now, for our last example of this installment, let's show some handles and see how they work.

[*]Start a new path
[*]Add some points with the paths tool
[*]As you're placing anchors, click and drag on one of the anchors as you place it. Notice that the handles now become visible.
[*]Hold down the Ctrl key and drag an handle. Notice only one handle moves. Try the same thing on the opposite anchor.
[*]To move both handles, hold down the Shft key and drag. The handles move simultaneously.
[*]To display handles on a point that's already been placed, make that anchor active by clicking on it with the paths tool (no keys need to be held down). Then, hold down the Ctrl key and drag away from the anchor. Only one anchor will be displayed at a time so, you'll have to do the same thing to the other side, if needed.
[*]Continue to add anchors and see how the handles have modified the look of the path.

Posted Image

Well, I'm literally exhausted! How you doing so far? My apologies for such a long introduction, but I felt it best we get this information out of the way. I promise the remaining lessons won't be as long, but they should be a lot more fun! Until then, have fun playing with the paths tool.


Art
0

#2 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 23 July 2005 - 09:56 PM

Welcome to Installment 2 of Creating and Using Paths.

Today, we'll cover the second way to create a path (Converting a Selection to a Path) and how to modify the selection to create some great results.

A couple of days ago, board member, capnhud, asked about an easy way to create a rectangle that had only a couple of the corners rounded. See this thread for the request: http://gimptalk.com/...p?a=v&t=547&f=2

At the time, I recommended using paths, but was unable to offer the steps in creating it. Since that time, capnhud has resolved his question, but I am now prepared to provide the steps.

But before we get into that, let's talk a bit about the paths dialog box. I left off a discussion of that in our last installment, as I felt I may have been giving you too much at one time. Right now, it's very appropriate.

Paths Dialog Box
Posted Image

Because you should be an advanced user, I won't discuss every button, but I did want to show you to very important tools and what a path component looks like (these were briefly discussed in the first installment).

The Selection to Path button (you can also use Select | To Path), will convert ANY selection into a path for further modification. Once modified, the path must be converted back into a selection (using the Path to Selection button, of course) in the Paths Dialog Box.

EDIT: Also note the 2 paths in the above screenshot. Each path contains more than one set of lines and/or closed polygons. These are referred to as components.

Let's create a rectangle with two rounded corners. Capnhud, this example's for you!

[*]Create a new document (I'm using 500X125)
[*]Add a new layer above
[*]Grab the rectangle selection tool and create a selection like in my example
[*]Convert selection to a path using the button in the path dialog box or by Select | To Path menu
[*]Turn on the path (click the eye button) in the path dialog box
[*]Get the paths tool and click on the path in the Image window to show the anchors (The cursor will turn into a hand pointing to the left indicating that you're about the select the path)
[*]Add anchors (Ctrl-click) as shown
[*]Delete corner anchors (Ctrl-Shft-click) as shown
[*]Convert path to selection (path dialog button or menu) – If you hover over the path to selection button, it will give you some additional options. I used the intersection option (Shft-Ctrl-click) NOTE: You do this on the button itself, not on the path. Corners are now removed.
[*]Turn off the path layer and return to the layers section of the dialog box.
[*]With the rounded selection still active, grab your bucket tool and fill it with any color you want.

VIOLA! You've created a round cornered rectangle.

Posted Image

Now, let's move on to some text manipulation.

Techyon really likes using text in his graphics. But none of the standard fonts really look like he wants them to. What's the poor guy to do? Give up? Not a chance. We've got the mighty paths tool to accomplish this task.
[*]Open a new document
[*]Grab the text tool and type out some something. I'm using “Techyon"
[*]I've added some guidelines for placement purposes, because paths will snap to guidelines just like the other GIMP tools.
[*]Alpha to Selection on the text layer to get the text outline
[*]Convert the selection to a path
[*]Grab the path tool and activate the path so we can see the anchors.
[*]Grab the anchors like I've done and move them to your hearts content.
[*]Once you're done, convert the path to a selection and fill the selection with color.

Walah! Techyon has the text looking like he's always wanted it to!

Posted Image

Here's what the final version looks like after I cleaned it up a bit:

Posted Image

Well, that's all for now. Let me know how you're doing. Aren't paths great?!



Art
0

#3 User is offline   BR7 

  • Member
  • PipPip
  • Group: Members
  • Posts: 569
  • Joined: 13-June 05

Posted 24 July 2005 - 12:34 AM

Nice job Fencepost very nice tutorial I give youPosted Image when I get some time I am going to give this a try
Posted Image
(Paypal Alternative 100% Legit)
0

#4 User is offline   capnhud 

  • Member
  • PipPip
  • Group: Members
  • Posts: 576
  • Joined: 13-July 05

Posted 24 July 2005 - 01:37 PM

Fencepost very nice job!!! Paths are wonderful. The animations really help out alot in understanding what you can do to manipulate an anchor point or path. Great work. Heck of alot easier to produce the shape than the way that I went about. Man you said you would have a tutorial on paths and I believe all users will benefit from it.
0

#5 User is offline   Ali Imran 

  • Owner
  • Group: Administrators
  • Posts: 2,308
  • Joined: 06-December 04
  • LocationDubai, UAE

Posted 24 July 2005 - 07:45 PM

I give 10/10 for thsi tutorial. I think it is the best among all other tutorials posted so far.
Very nice explanations and illustrations (which are ofcoruse very easy to follow just by viewing even if reader does not read the text).

thumbs up art.

regards
0

#6 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 25 July 2005 - 01:27 AM

Thanks everyone for the nice compliments!

This isn't an installment per se, but probably the thing most people will be interested in is using paths to cutout images from a background. Below is a graphic that shows a before and after shot cutout using the path creation/modification instructions I've given in installment 2 above. It's a little rough on the edges, but I just wanted to show how the tool worked.

The third and final installment may be awhile coming as I may be going out of town on business this week.

Enjoy!

Posted Image

Art
0

#7 User is offline   droz928 

  • Member
  • PipPip
  • Group: Members
  • Posts: 568
  • Joined: 12-June 05

Posted 25 July 2005 - 03:08 PM

Very nice tut. I rate it 10 out 10. I love the path tool. It is the one feature of gimp I couldn't do with out. You can do other cool things with the path tool like the stroke to path. Using the stroke feature you can create some cool neon lines and shapes.
0

#8 User is offline   techyon 

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 16-May 05

Posted 25 July 2005 - 03:50 PM

Excellent job, this tutorial has cleared a lot of the misconception of paths and has added more tools for the imagination.

Wow! :l:
0

#9 User is offline   Sasha 

  • Member
  • PipPip
  • Group: Members
  • Posts: 36
  • Joined: 06-July 05

Posted 26 July 2005 - 08:07 PM

wow this is a tutorial I'll use!
thank you!
0

#10 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 30 July 2005 - 02:23 AM

Well, here's the 3rd and final installment on creating and using paths! This certainly has been the most intense one to prepare, but I'll honestly admit that I've learned a tremendous amount. I guess the old saying, "That which doesn't kill you, will only make you stronger", is very true. I'm now a much better GIMP user, at least as it relates to paths :w:

This lesson will deal with using creating and using paths within GIMP's Animation Program (GAP). You must have an understanding of the GAP before attempting this session, as I will only be going over the more important steps.

Just with any session you're preparing to use with GAP, you need a background.xcf and an .xcf file containing the items you want to animate. To simplify, I will only be animating one item - the text "Rolling Along". You can animate anything, not just text.

Here are my images:

Posted Image

and

Posted Image

The animation items image is actually the same size as the backgroung image.

Let's begin!

On the background.xcf, create the path of your choice. It can be straight or curved. Mine does a loop. Please note that I created the curves by placing individual points. You cannot just use your handles to create the curves, as GAP will draw straight lines between each point you place.

Posted Image

As you can see, my path is not really "curvy", but angular due to placing the individual points. That's the price you pay! Now, for all you really smart folks out there, you're probably saying to yourself, "I'll just add more and more points to make it approximate a curve even more!" Save that thought for calculus class my young students. That's not a good idea either. Reason being, is that you cannot have more path points than number of frames in your animation. (At least not that I can find, yet) You must have the same or less number of paths than the number of frames. Repeat this to yourself over and over. :w: Also, to help you later, just keep track of the number of points you place.

Before we proceed, here's a key point: If you're going to create several paths to animate, name each path something you can relate to later. For example if you first layer is called "#1", rename the path "#1". Also, before you go into the Move Paths portion of GAP, make sure you make the path active for the layer you are going to animate. GAP only sees the currently active path. If you forget to do this and path #1 is active, but you want to animate layer #2, GAP will grab ahold of path #1.

Now that you've placed your points, activate or highlight the path name and open up GAP (Video | Duplicate Frames) and type in the number of frames you want for the animation. Remember, it must be at least the same number or greater than the number of points in your path. I used 19 under the Duplicate Frames dialog because that's how many points I set.

Now, let's animate along the path we just created.

Go to Video | Move Path and use the following settings:

Posted Image

Now, check out your new animation:

Posted Image

If you're satisfied with the results, finalize the graphic using the steps outlined in Sean-Michael's GAP tutorials and save as an animated gif.

I hope you've enjoyed this lesson. It's been a tremendous learning experience for me and hope that it has been for you, as well.

Happy Gimping.

Art
0

#11 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 05 August 2005 - 04:19 PM

I've added a separate tutorial on using paths to cut out renders, which may be viewed here:

http://www.gimptalk....p?a=v&t=769&f=8

Enjoy!

Art
0

#12 User is offline   daoo 

  • Member
  • PipPip
  • Group: Members
  • Posts: 64
  • Joined: 20-July 05

Posted 06 August 2005 - 08:38 AM

Great Tutorial!
Posted Image
0

#13 User is offline   Chrios 

  • Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: 09-August 05

Posted 09 August 2005 - 09:30 AM

man that is awsome a quick and easy way to make animations... cool thumbs up dude

EDIT : man how did you make that wicked background?
0

#14 User is offline   daoo 

  • Member
  • PipPip
  • Group: Members
  • Posts: 64
  • Joined: 20-July 05

Posted 09 August 2005 - 06:10 PM

Easy. Follow step 1,2,3 in the foil paper tutorial http://www.gimptalk....p?a=v&t=329&f=8
Then Layers > Colors > Curves and give it the color you want :)
0

#15 User is offline   regimen de caos 

  • Member
  • PipPip
  • Group: Members
  • Posts: 265
  • Joined: 25-July 05

Posted 09 August 2005 - 07:05 PM

I don't know what's up, but my anchors don't show up well:

Sometimes they'll apear like this

Posted Image

But, If I wave the mouse or screen, it will change, and could look like this:

Posted Image

Can anyone explain this, I use Gimp 2.2.8, and Windows XP.
0

#16 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 09 August 2005 - 07:07 PM

I've never had that happen and I'm using the same OS and GIMP version. Will they appear if you click on the spot where they should be?

A
0

#17 User is offline   regimen de caos 

  • Member
  • PipPip
  • Group: Members
  • Posts: 265
  • Joined: 25-July 05

Posted 10 August 2005 - 10:23 PM

Quote

I've never had that happen and I'm using the same OS and GIMP version. Will they appear if you click on the spot where they should be?

A

Nope, and it makes it very difficult to do your text manipulation. It doesn't really affect renders however, unless I need to find the anchor points.
0

#18 User is offline   Kill the DJ 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 28-August 05

Posted 29 August 2005 - 01:32 AM

EDIT: Sorry, didn't realize the tutorial on cutting out renders was what I needed. Stone the n00b, I'll take it like a man.

Or not.
0

#19 User is offline   fencepost 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,646
  • Joined: 01-March 05

Posted 29 August 2005 - 01:31 PM

Welcome to the boards, Kill the dj!

Glad you found what you were looking for. Feel free to post any questions you have or send me a PM if you need additional information.

Art
0

#20 User is offline   Noble 

  • Member
  • PipPip
  • Group: Members
  • Posts: 294
  • Joined: 31-July 05

Posted 29 August 2005 - 10:14 PM

Nice tut, quick question, how to "name" paths? Nvm... I forgot there was a paths dialog.
Posted Image
0

Share this topic:


  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic