
DRAW USING PATH
an Image Magick tutorial by Flo |
The following results were obtained using Image Magick. This tutorial is for those who know how to make a transparent background at Image Magick.
Draw/Path at Image Magic is for making complicated lines. There are 2 sets of commands: the Absolutes, expressed with capital letters; and the relatives, expressed in lower case letters. An Absolute command's coordinates ALWAYS refer to distance from the Northwest corner of the image. If you have drawn a line from point A to point B and then want to draw an Arc starting at point B, you would use Relative command coords that start from point B, not the NW corner.
This tute is about using only some of the Relatives by themselves. Doing this gets a person stepped lines. All angles will be right angles (90 degrees) and the line will descend. If you want angles and directions other than this, you should use Draw/Polyline, or learn how to use the Path Absolutes (which I have yet to learn).
The parameters are different from all the other Draw tools:
- Starting Point: m followed by 2 numbers separated by a comma. The path/line moves from this point. (Since this is the first moveto command, it is actually an Absolute, but we can us the lower case letter.)
Example: m10,15
The first number, 10, is the X coordinate - how far from the left edge you want the path to start. The second number, 15, is the Y coordinate - how far from the top you want the path to start.
- Horizontal Distance: h50,
Example: m10,15 h50
- Vertical Distance: v25
Example: m10,15 h50 v25

- Close: z Just add this at the end.
Example: m10,15 h50 v25 z

Here's the basic formula:
NOTES: Repeat as many h and v as you want for each path.
You can also start with the v first, then the h.
To get the path lines to go in the opposite direction, just Transform/Flop (or Flip, or Rotate Left, Right)
If your background is transparent remember to output as a .gif to maintain the transparency.
Here's a gif made using Path for the white, yellow and orange lines and Arc for the red:
Another gif, showing that the z takes the shortest route to connect the starting and ending points.
Here's Sleeper's image showing what's possible with a little creativity applied to using Path.

Many thanks go to Diana, Sleeper, Ron and Jean of the former Imaging Artists News Group for helping me understand part of Path.
Back to Flo's Image Magick Draw Tutes
|
|