Width Gradient

Article ID: 1bb83350-7332-4bda-a36f-bb35729f5037

Width Gradient is an Astute Graphics tool and panel for Adobe Illustrator that allows you to change the stroke widths along one or more paths by simply dragging across them. Paths are changed to variable width if necessary, such that their widths at any spot are based on their positions along the drawn virtual linear or radial gradient. Width Gradient is part of the WidthScribe plugin.

Width Gradient in Action

Width Gradient in Action

Width Gradient Tool

Article ID: 4b951590-7f8a-4890-8c1a-e1d55e0cfa9e

Tool Location and Cursor Appearance

The Width Gradient tool appears in Illustrator’s main toolbar (which must be in Advanced mode: View > Toolbars > Advanced).

Width Gradient Tool Location

Width Gradient Tool Location

 The Width Gradient tool’s cursor is a crosshair, accompanied by a caption if no paths are selected: 

Width Gradient Cursors

Width Gradient Cursors

Width Gradient Tool Operation

As the Width Gradient tool has several keypresses for certain operations, we suggest installing the free Astute Graphics plugin Astute Buddy, which creates a panel that dynamically updates to inform you of the various keys which can be pressed in the tool’s current context.

The Width Gradient tool works in conjunction with the associated Width Gradient panel, which should be open and accessible. If you are using the free Astute Graphics plugin DirectPrefs, you can have the Width Gradient panel automatically be shown when the Width Gradient tool is selected.

Using the Width Gradient tool is similar to using the Gradient tool in Photoshop, except an actual color-to-color gradient is not generated. Instead, all selected paths that fall within the bounds of the virtual gradient are converted to variable width (if they aren’t already), and their width markers are adjusted using values corresponding to each location along the virtual gradient, as specified in the Width Gradient panel. Adjustment may be in either an absolute sense (the widths are changed to specific values) or a relative sense (the widths are changed to a percentage of their original values).

For example, if the panel were set to adjust in an absolute, linear fashion, with start and end widths of 4 pt and 20 pt, then after dragging the tool, spots along the path(s) that were in line with the start of the gradient would get width markers set to 4 pt, while those in line with the end of the gradient would get width markers set to 20 pt. Those in the middle would receive a width of 12 pt (because half of 4 + 20 is 12, and the panel graph is linear). 

Width Gradient Basic Example

Width Gradient Basic Example

Of course, the line in the previous example could easily have had its widths set manually with the native Width tool, since only a single width marker at each end was necessary. The real power of Width Gradient comes when multiple paths are adjusted, possibly in a non-linear manner: 

Width Gradient Example

Width Gradient Example

The tool draws annotations while in use, showing the start and end points of the gradient (represented by a gray, semi-transparent line), and, using semi-transparent dashed lines, either perpendiculars to the gradient (for linear gradients) or a circle at the outer edge of the gradient (for radial gradients).

Width Gradient Tool Annotations

Width Gradient Tool Annotations

In addition, by default, the new widths of the path(s) are previewed, using a solid, user-specifiable color (red, by default). This preview is only approximate and may not agree exactly with the final paths. In particular, corner joins and end caps are not previewed.

While dragging with the Width Gradient tool, a number of keypresses may be used:

  • Shift: Constrains the gradient angle to 45° angles around the general constrain angle.

  • Option/Alt: Toggles between linear and radial mode.

  • Space: Repositions the entire gradient.

  • Up Arrow/Down Arrow: Adjusts the bottom width value on the panel (typically assigned to the start of the gradient). For each keypress, the value is changed by 1 pt (in absolute mode) or 10% (in relative mode).

  • Left Arrow/Right Arrow: Adjusts the top width value on the panel (typically assigned to the end of the gradient). For each keypress, the value is changed by 1 pt (in absolute mode) or 10% (in relative mode).

  • C: Switches the width preview color (if enabled) between red and blue.

  • S: Switches the affected strokes (between all strokes, which is the default), and the focal stroke only. This is only makes a difference if the path has multiple strokes on it: 

Width Gradient All Strokes vs. Focal Stroke

Width Gradient All Strokes vs. Focal Stroke

  • U: Temporarily disables Smart Guides, if they were enabled when the drag started.

  • W: Swaps the adjustment widths. For linear gradients, this is the same as reversing its direction.

Although Width Gradient can be used on compound paths, because each subpath must share the same width profile, results may not be as expected. A warning dialog will be displayed in this situation:

Width Gradient Compound Path Warning

Width Gradient Compound Path Warning

Width Gradient Panel

Article ID: 95b7ff2e-d2ce-4b85-91a5-b6d675ea0f9f

The menu item to show and hide the Width Gradient panel can be found in the main menu under Window > Astute Graphics > Width Gradient. When the Width Gradient tool is not in use, the panel displays only a “Click to select” message; clicking anywhere on the panel selects the tool and displays all the controls, which affect the next use of the tool.

Width Gradient Panel

Width Gradient Panel

1. Flyout menu

See Width Gradient Panel: Flyout Menu

2. Panel banner

The Width Gradient panel banner has a help button on the right which opens the help documentation in the Astute Manager. If this does not automatically appear, please ensure your Astute Manager is running first.

3. Linear/Radial Mode

Switches the tool between linear (straight line) and radial (circular) modes. This can be accomplished while dragging the tool by holding down the Option/Alt key.

4. Absolute/Relative Adjustment

Switches the tool’s adjustment type. When set to absolute, width markers are set to the widths calculated based solely on the adjustment values, graph, and position along the virtual gradient; the original width has no influence on the final width. When set to relative, the width at each marker is calculated as a percentage of the original width of the stroke at that position along the path.

Width Gradient Absolute vs. Relative

Width Gradient Absolute vs. Relative

5. Optimization

When enabled, the number of width markers in the resulting paths will be reduced after the gradient has been applied. The degree of optimization can be set from 0 to 10, with a default of 5. Higher optimization values will remove more width markers, making the path profile smoother and easier to edit manually, but may result in slightly less accurate results compared to the unoptimized results. The number of width markers on a selected path is displayed at the bottom of the panel, if Display Marker Count is enabled in the panel flyout menu.

Width Gradient Optimization

Width Gradient Optimization

6. Adjustment Value 1

Because it is at the top, this value can be thought of as the “maximum” value, although it can be set to any value. When the graph curve is set to the default (a straight line rising from lower left to upper right), it controls the width at the end of the gradient. It can be changed while dragging the tool by pressing the Left Arrow and Right Arrow keys.

7. Switch button

Switches the two adjustment values; this can also be achieved while dragging the tool by pressing the W key.

8. Adjustment Value 2

Because it is at the bottom, this value can be thought of as the “minimum” value, although it can be set to any value. When the graph curve is set to the default (a straight line rising from lower left to upper right), it controls the width at the start of the gradient. It can be changed while dragging the tool by pressing the Up Arrow and Down Arrow keys. 

9. Graph

Specifies the relationship between the adjustment values and the gradient. The horizontal axis represents positions along the gradient (from beginning to end), while the vertical axis represents the adjustment amount, specified by the “maximum” and “minimum” value inputs. With the default diagonal line, the relationship is a linear one. Nodes on the curve may be moved simply by clicking and dragging them. A new node may be added by clicking at a spot along the curve which does not already have a node. Nodes (except the ones at the beginning and the end of the curve) may be deleted by dragging them off the graph area. 

Width Gradient Graph Examples

Width Gradient Graph Examples

10. Graph Preset Menu

Provides access to saving, managing, and applying graph settings.

Width Gradient Graph Preset Menu

Width Gradient Graph Preset Menu

A. Save Graph…

When you save the current graph, its nodes and maximum and minimum values are captured to an internal file which can be recalled later. The file name may be specified.

B. Manage Graphs…

Brings up the Manage Graphs dialog, which lets you rename, delete, import, or export graph files: 

Width Gradient Manage Graphs Dialog

Width Gradient Manage Graphs Dialog

a. Rename: Allows the selected graph file to be renamed.

b. Delete: Removes the selected graph file(s). 

c. Import...: Imports a previously-exported graphs package file of type “.wgg” using the standard operating system open file dialog.

d. Export...: Exports the selected graph(s) into a graphs package file of type “.wgg” using the standard operating system save file dialog. This file could be used as a backup or passed to another user.

C. Graphs List

Choosing a graph file from this list will update the graph to the values saved within that file (or, the case of “[Default]”, to the default graph). If the Shift key is held down when choosing a graph file, then the current maximum and minimum adjustment values will be retained rather than being loaded from the graph file. When the plugin is first installed, five presets will be added; their names are indicative of the shapes of the curves (for example, curve named “V” goes down and back up).

11. Reapply Gradient button

Reapplies the gradient at its previous position but possibly with new optimization, adjustment width, and graph settings. This allows you to try different parameters without having to actually drag out the gradient in the exact same spot repeatedly. Note: The reapplied gradient will always keep its original mode, i.e. linear or radial. For Relative Adjustment gradients, the path’s width markers will be restored to their original values before the gradient is reapplied unless Option/Alt is held down when clicking the button; in that case the gradient will modify the already-adjusted widths. If the adjustment were set from 102% to 102%, say, this could be useful for incrementally increasing all the stroke weights of the selected paths until they “look right.”

12. Marker Count

Displays the number of width markers (if any) on the selected paths. To visualize these width markers, use the Width Selector tool (also part of the WidthScribe plugin).

Width Gradient Panel Flyout

Width Gradient Panel Flyout Menu

Width Gradient Panel Flyout Menu

1. Hide Curve

The middle section of the panel (containing the adjustment value input boxes, Switch button, graph, and Reapply Gradient button) can be shown or hidden using this menu item to save space. When the controls are hidden, the menu item will change to Show Curve. 

2. Show Preview

When marked with a check mark (the default), paths will be annotated to show an approximation of their final widths when using the Width Gradient tool.

3. Display Marker Count

When marked with a check mark (the default), the informational line showing width marker counts will be shown at the bottom of the panel.

5. Reset Warning Dialogs

If one or more of Width Gradient’s warning dialogs have been suppressed using the Don’t show again checkbox, choosing this menu item will re-enable them.