Saturday, May 22, 2010

GIMP Tutorial: Working With The Shapes Paths Script

Shape Paths is one of the very first scripts I loaded into GIMP. My goal at the time was to try and make GIMP as comfortable to use as Paint Shop Pro's "shapes" gallery. There is a significant difference between both applications, since GIMP doesn't have its own internal "shapes" library and you are required to save your shapes into a .xcf file in order to retain them.
When I started using paths in GIMP, I was originally thinking along the lines of creating "vectors". Unfortunately, GIMP is a raster based program. So, if vectors are what you're wanting, it's best to build them directly into whichever vector application you decide to use. Inkscape is a free vector program that uses the svg format.
If you have never downloaded scripts or plug-ins into GIMP, read my tutorial on that, here.
Shape-path-0.91.scm is the most current version. Don't make the same mistake I did and attempt to install both the .7 and 0.91 versions. Just stick with 0.91. Once you have it installed and the scripts refreshed, you should find the script under the Script-Fu/Shape Paths menu at the top of your drawing window.
There are 14 path options, a few of which are self-explanatory, but if you feel intimidated by the menu prompts for any of these options, you aren't alone. I'll do my best to break down the menus with screenshots so that they make sense for you to use them.
Advanced Rounded Rectangle:
The menu prompt

If that doesn't intimidate you, that's good, but it's easy to see how it could.
Let's break this menu down further to make it easier to comprehend:

You might be asking yourself, "Is there an easier way to achieve this?" The answer is yes, although you might lose node accuracy. Simply use the Rectangle selection tool, set to rounded at 25 degrees, and save the resulting selection to a path (Select – To Path). However, check the node points (Path dialog – tick the Eye icon) between the two path variations, you'll notice a difference in the number of nodes. If accuracy is important to you, stick with the shape path option (fewer nodes).
Circle and Ellipse
Both are pretty self-explanatory. Select your x and y positions, and input your radius (how wide and tall you want the ellipse to be).
Flowers and Spikes
This totally baffled me when I first used it. After a little tinkering with the inputs it soon became somewhat easier to use. The menu defaults:

Locating center on the drawing (x and y) not a problem. Radius, think in terms of dimensions – or – (radius x 2 = diameter) so a 100 px radius will give you a diameter of 200 px.
Now, I'm not going to even pretend I know what I am talking about in regards to the Factors A and B, and their angular displacements. But what I will tell you is that if you experiment in small increments, and keep the angular displacements symmetrical (90 degrees for both) you'll get more pointed flower petal shapes, depending on how many sides you choose to implement and how high you make the factors of those displacements. Here is an example of a 7 petal flower I made using the following settings on a 640 x 640 px drawing:

If I had kept both factors A and B positive, the curve points would have pushed both sides of the petal/spike in the same direction, much like a tri-fold paper being folded flat. I truly tried to find more information on the mathematics of this path function and came up short (when comparing it to the code within the script). It would be really cool if Jon Stipe or Pucelo (the authors of the script) chimed in and explained this process more definitively and thoroughly.
Easier way to perform this function? Not really, especially if you're wanting symmetry. You could always throw out some path points and work out the bezier curve points on your own (you'll need a grid and guidelines), but if the mere changing of a few numbers on this menu is all that's needed, why bother? I've made some really cool designs using this script. Experimentation is strongly encouraged, but keep in mind, make small changes, gradually. A combination of paths make some pretty interesting designs.
Also, if anyone viewing this post knows what the factors and angular displacements are all about, please chime in via comments, and I'll add it to this post.

Pretty straight forward to use. The difference between the Outer and Inner radius determines how short or long your gear teeth will be. The greater the number between them, the longer your gear teeth will be. Although there is no actual way to manipulate the nodes using the script's menu options, you can physically edit the path points and make some really interesting designs. Gears, like Flowers and Spikes need a tutorial all their own.
One thing I want to point out: it's not an oval if all 4 radius sides are the same. To elongate to oval shapes, make L and R sides larger or smaller than the Top and Bottom.
One important note for miters, when using Polygon: (360/(numbers of sides x 2) gives you miter degrees. How is this important? Well, say you want to make an 8 sided stop sign, but you're not sure what rotation to use to flatten the top and bottom sides. To get the octagon to lay on its side (flat) rather than its point, you add the miter degree to your rotation. You can also get some really cool designs overlapping and merging rotated polygons. Note the example below:
Rectangle and Rounded Rectangle
Straightforward to use.
Sine Wave
Amplitude is actually half the distance from peak to valley, so if you selected amplitude to be 75 px, the sine wave from peak to valley will equal 150 px (75 pixels times 2). 
Wavelength is the distance between the cycles, so if you had 3 cycles and wavelengths were set to 70 px, your sine wave would be 210 px in length. This is good to know if you're using sine wave decoratively.
One other important note: even if you pick the exact center of your image, the wave does not center itself on those x and y points, it starts the wave from center in L to R orientation.
Square Wave
Each setting was done individually, not all at the same time.
Just like Sine Wave, positioning at exact x and y center does not center the wave, it starts from that point in L to R orientation.
Straightforward to use.
Identical to Gears in every way except each star segment comes to a point, not a flat top. I will be using this function for my next tutorial on making raster clip art.
Triangle Wave
Somewhat like Square Wave, minus the convergence and displacement. Instead it has rounding and shearing. Note the image below:
I hope this brief description gives you a better idea of how these shapes can be used via menu options. Should I get more information on Flowers and Spikes, I'll repost it here. Be looking forward to my next tutorial on creating raster clip art using the "Star" shape path script.
Thank you for stopping by! 

No comments:

Post a Comment

If you intend to comment to complain about being unable to perform certain steps with tutorials, please explain where you are in the step process and what step you are unable to get to work correctly, instead of saying something like, "I can't do this!". Your comments will help get tutorial corrections made and help give clarification to future viewers who may have trouble in the same locations. Thank you. :)