TRICKS OF THE TRADE - PATH

The members of the Imaging Artists newsgroup shared their expertise and discoveries with each other.

This page is devoted to tips by Diana and Sleeper for those using Draw/Path at the Image Magick studio.


Shaving a Wave
Find That Spot
Saving Details
Beware of Shadows
Save Time with Preview
Information Center
Colorwrap
Crop & Shave
Chop-Crop
Get Rid of the Center
Simple Crop
Color Patch
Colormap vs. Output
Hex Codes for Chocolate
Background Images Inside Draw
Transparent vs None
Outputting Transparent Gifs
DRAW-Path
Cubic vs Quadratic Beziers
More About s, q & t
Drawing Leaves


Cubic vs Quadratic Beziers -
From Diana (BeeDiana):


Both can be done with ImageMagick under DRAW and primitive PATH. The difference:

A Quadratic Bezier segment is determined by a start point, an end point and ONE controlpoint.

Prefix is Q and q
For a smooth curve use T or t.

A Cubic Bezier segment is determined by a start point, an end point and TWO control points.

Prefix is C and c
For a smoother curve use S or s.

Example:

400x250 .xc bg; meta: white; Draw/Path
Fill Color=none; Stroke Color=blue; Stroke Width=2



Draw Path again: Stroke Color=red

blue= cubic bezier; red= quadratic bezier



I hope that helps to understand the difference. Someone emailed me this question.

The 3rd Path Curve we can draw is the Elliptical Arc. It's basically what the name says, a segment of an ellipse. Prefix is A or a. (using Path in Draw)

ADDED NOTE by Sleeper (SLEE_per): You can also use the s on the Quadratic Bezier to make straight lines. (see next)
Cubic vs Quadratic Beziers -
From Sleeper (SLEE_per):




The only differance in the coords below is the Move-to "s" and the changing of the "s" to "q" is viceversa.

350x350 xc ~ Left side using s.



Right side using q.

More About "s" & "q" & "t"-
From Diana (BeeDiana):


I never thought of using the 's' prefix in quadratic bezier, because it is according to the W3.org assigned to cubic bezier. The assigned prefix for quadratic is q and t. Did you ever try it with a 't' instead of s?

It's really cool. "T" or "t' as in Tom.



NOTE: Flo used the above coords: 350x350 xc; had to use Translate at 70.0, 0.0 as Diana's figures placed it half off the bg to the left.



Diana: The 's' or the absolute "S" is usually used in conjunction with the cubic bezier. I haven't tried this yet, but who knows:



Notice that it doesn't use q or t. Just c and s.

NOTE: Flo used the above coords: 400x400 xc; had to use Translate at 50.0, 0.0 as Diana's figures placed it half off the bg to the left, and then crop.



Diana: At least that's what I've learned from IM's John Cristy, that the 'regular' determined prefixes for this type of Path are pre-programmed by SVG standards.

I think mixing them and seeing what happens is fun. Have you tried already mixing them with the 'A' or 'a'?
Combining Quadratic & Cubic Commands in the Same Path-
From Diana (BeeDiana):


Thanks to Sleeper's instructions, I just found out that you can combine quadratic and cubic prefixes in path and come out with results. It seems to work better with 'relative' prefixes though. Absolute letters work also, but don't result in the same forms.

Something simple: a bow





100x100 .xc; Meta= black; Stroke Color= white; Stroke Width=1; Fill Color= none (it will look like a bikini top if you add a fill color lol). If you want a multicolored bow, use Translate and add a few pixels and different stroke colors.
Drawing Leaves with Path-
From Diana (BeeDiana):


To Draw the outline of an oak leaf

Make a 150x200 transparent.xc. Click on Draw, then Path. Stroke Color=gray70; Stroke Width=1



Go to Effects: Spread 2.5x2.75 (I add the veins later) and click Sepia.
Output as a gif. Get temporary url on goto key.
Cick on Input. Change xc to plasma. Meta= darkgoldenrod4-tomato4.
Keep size the same. Click on View.
Click on Enhance. Click on Brightness; type in 45 in parameter box; Click on Enhance.

Composite sepia leaf (temporary url)/Over

Paint/Floodfill the inside of leaf again with goldenrod3-tomato3; add some goldenrod1 veins (draw lines) where you like them.

Resize to 75x100!
Decorate/Frame - goldenrod1; Frame - orange4; Raised; Border - #191607; Raised; 3 large Borders mixed in darkbrown; Raised two times; Sunken once.

Output - Image Type=Palette, JPG, single file, quality 70.

I actually 'sepia'ed the entire frames again to give it that vintage look.


The above information Copyright 2007 by the above authors

Page Copyright 2007 by Tone By Tone Dot Net