Zuber Photographics Home

 

 

 

 

 

 

Panoramic

Print Friendly  Print||All Topics>Photoshop>Topics>Paths Introduction

Paths

Create selections and vector graphics that can be resized without loss of detail


Vector Graphics and Raster Images

Raster images are composed of pixels.  Pixel based file formats, such as JPEG, Raw, TIFF and PSD, are well suited for photographic images because they are excellent at storing tonal gradations.  However, enlarging a pixel based image can adversely affect edge sharpness. 

A vector image is composed of mathematically defined curves and lines.  If I draw a straight line using pixels, Photoshop will create a series of pixels one after the other to create the line.  But when I create that same line using vectors, I create a beginning point, lets call it (x1,y1), and then I create an ending point, lets call it (x2,y2).  Photoshop, and other vector rendering programs, will then automatically construct a virtual line between points (x1,y1) and (x2,y2).  The reason it is virtual is because Photoshop does not store the line.  It only stores the points.  And whenever you display the graphic, Photoshop will recreate the virtual line between (x1,y1) and (x2,y2).  These points are known as anchor points.  Because vector graphics are mathematically constructed, they can be greatly enlarged without loss of detail.  However, vector images are not good for storing tonal gradations.  Therefore, they are not suited for photographic images.

In Photoshop, the anchor points (x1,y1) and (x2,y2) and the line between is called a Path. The advantage of using Paths instead of pixels is scalability.  If I resize a pixel graphic, Photoshop must either create new pixels or throw some away, depending if I am enlarging or reducing.  Resizing pixels can lead to a loss of edge sharpness.  With Path resizing, there is no loss of edge sharpness because the line or curve between anchor points does not physically exist in the graphic file.  Only the anchor points do.  When resizing Paths, Photoshop only needs to reposition the anchor points.  Once repositioned, it then redraws the line or curve between the points.

How do we create these anchor points?  With the Pen tool Pen tool.  When creating Paths, the Pen tool is not used in the traditional sense of drawing with pen or pencil.  You do not click and drag to draw the line.  You click at each location you want an anchor point.  Photoshop will then draw the line or curve for you.
 

Concepts

Lines and curves are the building blocks of vector shapes.  We use the Pen tool to create lines and curves.  We call the lines and curves we create a path.  It is the path that defines our shape.  A path can be as simple as a single line or a single curve.  Or a path can be complex, consisting of many lines and curves.  When creating a path, you do not draw it like you would draw with brush on paper.  Instead, you create a path by clicking and creating anchor points.  It is the anchor points that define the begin and end points of our lines and curves.

Tip

When creating a path, the fewer the anchor points, the better.

 

A path can be open or closed.  In a closed path the beginning anchor point and the ending anchor point are the same.  In an open path, the beginning anchor point and the ending anchor point are different.  The path shown in Figure 1 is a closed path.

Tip

To stop creating a path at any time, either close the path or Ctrl + click (Command + click) anywhere in the document window.

 

Nomenclature

Paths and Shapes
Figure 1.  Paths and Shapes

Lets review the terms we will encounter when working with Paths and Shapes.

Path – Consists of two or more anchor points and the line or curve between them.

Shape – A vector based graphic created by one or more paths.  The path(s) are stored in either a shape layer's vector mask or in the Paths panel.

Anchor point – This is the foundation of a Path.  There are two types of path anchor points; static and dynamic.  Static anchor points can only have a straight line between them.  Dynamic anchor points will have one or two handles that allow you to bend the line into a curve.  Anchor points are represented by a small square.  If the square is hollow, it is unselected.  If the square is solid black, it is selected.

Handle anchor point – A dynamic anchor point’s handle is how you bend a line into a curve.  You can make two kinds of adjustments using the handle.  How long the handle is determines the radius of the curve.  How you rotate the handle around its anchor point determines the shape of the curve.  A dynamic anchor point can have one or two handles.  Visually, a handle may look like part of the path, but it is not.  Path anchor points are represented by a square.  Handle anchor points are represented by a diamond.

Shape layer – A Photoshop adjustment layer consisting of a solid color fill adjustment layer with a vector mask, as shown in Figure 2.  Typically, a single shape layer has one path.  But it is possible for a single shape layer to have more than one path defined in its vector mask.

Paths panel – The Photoshop panel where vector paths are stored, as shown in Figure 3.  If a shape layer is highlighted in the Layers panel, then its vector mask will be visible in the Paths panel.  Unlike the Layers panel and the Channels panel that must have at least one layer or channel, the Paths panel will be empty if there are no paths.
 

Shape LayerFigure 2.  Shape Layer

Paths PanelFigure 3.  Paths Panel

Tip

A path can be stored in one of two places.  Either in the vector mask of a shape layer.  Or in the Paths panel.  If you wish to store the path in the Paths panel, the path must be renamed by double clicking its name in the Paths panel and giving it a meaningful name.  If a path is not stored in either a vector mask or in a renamed path, it could be lost the next time a path is created.

 

Tools

The following tools are used when creating vector graphics or path selections.

Pen Tool Pen tool – This is the primary tool for creating path anchor points.  Each click will create an anchor point.

Freeform Tool Freeform Pen tool – The Freeform Pen tool is a true drawing tool.  You have to click, hold and drag to draw your path.  You can have Photoshop smooth out the lines and curves you draw by using the Curve Fit option in Geometry Options.

Delete Anchor Point Delete Anchor Point tool – This tool will delete an anchor point on an existing path.

Add Anchor Point Add Anchor Point tool – This tool will add an anchor point to an existing path.

Convert Anchor Point Convert Anchor tool – This tool will convert a static anchor point to a dynamic anchor point and vice versa.  If there is a curve between two anchor points and you convert the anchor points to a static anchor points, the curve will be converted into a straight line.

Path Selection Path Selection tool– This tool will select a path whenever you click anywhere inside the shape created by the path.  You move a path using the Path Selection tool and not the Move tool.

Direct Selection Direct Selection tool– This tool will select a path when you click directly on the path.  If you click and drag a path anchor point, only that anchor point moves.

Shape tools – Photoshop has a number of tools that can be used to create predefined shapes.  They are the Rectangle (square) tool Rectangle tool, Rounded Rectangle (rounded square) tool Rounded Rectangle tool, Ellipse (circle) tool Ellipse tool, Polygon (star, triangle) tool Polygon tool, Line (arrow) tool Line tool and the Custom Shape tool Custom Shape tool.  The name in parenthesis is a shape that can be drawn with that tool.  For example, I can use the Polygon tool to also draw stars and equilateral triangles.
 

Tip

To deselect a path, either activate a non-shape layer or click in any unused portion of the Paths panel.

 

Pen Tool Option Bar

Figure 4 below shows two versions of the Pen tool option bar.  The top version is what you will see if the Shape Layers option (A) is selected.  The bottom version is what you will see if the Paths option (B) is selected.  Each of the options is described below.

Pen tool option bar
Figure 4.  Pen Tool Option Bar

A – Shape layers option.  If selected, when you create a path, Photoshop will automatically create a shape layer and store the path you are creating in the vector mask.

B – Paths option.  If selected, when you create a path, Photoshop will store the path in the Paths panel.  If you do not rename this path, it could be lost the next time you create a path.

C – Fill pixels option.  Only available with the Shape tools (F - K).  If this option is selected, you are no longer creating paths.  Instead, Photoshop will create a normal layer and create the shape you selected with pixels.  This is how you can create a raster shape instead of a vector shape.

D – Pen tool.  Selecting this will activate the Pen tool.

E – Freefrom Pen tool.

F – Rectangle (square) tool.  Selecting this will activate the Rectangle tool.  This tool can also be used to draw squares.

G – Rounded Rectangle (rounded square) tool.  Selecting this will activate the Rounded Rectangle tool.  This tool can also be used to draw a rounded edge square.

H – Ellipse (circle) tool.  Selecting this will activate the Ellipse tool.  This tool can also be used to draw circles.

I – Polygon (star, triangle) tool.  Selecting this will activate the Polygon tool.  This tool can also be used to draw stars and equilateral triangles.

J – Line (arrow) tool.  Selecting this will activate the Line tool.  This tool can also be used to draw single and double headed arrows.
 
K – Custom Shape tool.  Selecting this will activate the Custom Shape.  This tool can be used to draw a variety of predefined shapes.

L – Geometry options.  Because of its close proximity to the Custom Shape tool, sometimes it is assumed this option only applies to the Custom Shape tool.  Geometry options are available to all of the tools on this option bar.  For example, it is the Geometry options that allow you to draw stars and triangles with the Polygon tool.

M – Auto Add/Delete.  This option is only available when the Pen tool is selected.  When checked, it enables the Pen tool to automatically change to the Add Anchor Point tool Add Anchor Point tool when positioned over an active path or to the Delete Anchor Point tool Delete Anchor Point tool when positioned over an existing anchor point.  The path must be selected for the Pen tool to automatically change.
 
N – Create new shape layer.  If Shape Layer option A is selected, this will cause Photoshop to create a new Shape Layer when a new path is drawn.

O – Add to shape area or path.  If Shape Layer option A is selected, the new path will be added to the vector mask of the shape layer.  If Paths option B is selected, the new path will be added to the existing path.

P – Subtract from shape area.  Where the new path overlaps the existing path, that part of the existing path will be removed from the shape.

Q – Intersect new shape areas.  Where the new path overlaps the existing path will be retained.  All other areas of the existing path will be removed from the shape.

R – Exclude overlapping shape areas.  The new path will be added to the vector mask or path.  However, where the new path overlaps the existing path, will be removed from the shape.

Style (not shown) – Allows you to apply a custom style to your shape.  This option is only visible if the Shape Layer option (A in Figure 4) is selected.

Color (not shown) – Allows you to set the color for the Solid Color Fill adjustment layer.  If the Create new shape layer option (N in Figure 4) is selected, the color will be applied to newly created shape layers.  If the modify shape layer options (O through R in Figure 4) are selected, the color will be applied to the existing shape layer.
 

Other Useful Options

There are two other options you may find useful when using the Pen tool.  The first is the Rubber Band option.  When the Pen tool is active, click on the Geometry Options down arrow.  The Rubber Band option will be exposed.  Checking this will turn this option on.  When this option is on, as you click with the Pen tool to create anchor points, Photoshop will draw a line or curve as you move the mouse to create the next anchor point.  This can be very useful as you learn how anchor points work.

For precision work, you can show a grid over your image.  The grid is shown by clicking View > Show > Grid.  If the snap-to-grid option is on (View > Snap To), then whenever you move your mouse near a grid intersection, Photoshop will automatically snap the cursor to that intersection point for precise placement of the anchor point.

Rubber Band optionFigure 5.  The Pen tool's Rubber Band option

GridFigure 6.  Grid