• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Photoshop - the Clipping path

Doug Kerr

Well-known member
One of (to me) the most curious constructs in Photoshop is the clipping path. Its primary intent relates to the world of page makeup ("publishing") applications, especially where there is a Postscript implication for the ultimate output. That's not a world I am truly familiar with, and this makes it difficult for me to wholly "get the point" of the clipping path in Photoshop.

That notwithstanding, I thought I would pass on my grasp of the matter. Perhaps those who use the construct will benefit from an "outsider's" insight into how it works.

Introduction

The image editing program Photoshop makes extensive use of mathematical constructs called paths. We can think of a path as an open or closed curve, where “curve” includes the possibility that it might be partly, or entirely, composed of (straight) lines.

Paths are theoretical constructs of zero width, and cannot themselves be part of an image. Rather, they can be used to define visible structures that will become part of the image; to define masks, structures that can be used to hide portions of an image and control over what portions of an image a certain change will be effective; and for another purpose we will discuss here.

Photoshop offers a large and often bewildering arsenal of tools to construct, change, and manipulate paths. We will not investigate much of that here.

The clipping path

A clipping path is a closed path that has been given a special assignment: to define the portion of an image layer that will be considered "live" when the image is exported to a publishing application or other similar environment. In that context, the final application of the limitation of visibility to part of an image may be done in the printer.

The objective is that the "vector" nature of the boundary of the region to be visible is retained, regardless of "scaling" of the whole structure. Thus, even though placement of a (pixel-oriented) image at a large scale in the final document may be afflicted by visible "jaggies" in the image proper, its boundary will be as "clean" as is supported by the resolution of the printer. This is in the interest of giving a much better impression to the ultimate viewer of the "precision" of the document.

In effect, we export to the publishing application (perhaps as an EPS file) a pixel-oriented image along with a mathematically-described (vector) instruction as to what part of it is to actually appear in the final printed document.

Postscript heads will feel comfortable with this. Me? A little bit.

Making a clipping path

Photoshop offers a bewildering arsenal of ways to make (or modify) a path. (I am in fact trying to finish a lengthy technical article - stalled for several months - on this topic.) Here, I will assume a simple way to make a path, and follow its life to its duty as a clipping path.

Making the path

One of the simplest way of making a (closed) path is to make a selection, using anything from a rectangular marquee tool to the very sophisticated "masking" tools we have available.

Note that the selection is a pixel construct (a particular type of pixel mask, in fact).

We then tell Photoshop to make a Work Path that describes the boundary of the transparent area of the selection.

A Work Path is a path in progress.​

If the mask includes semitransparency, the Work Path follows the "50% transparent contour".​

One way is to make a Work Path from a Selection is to, on the Paths panel, bring down the menu (with the icon in the upper-right corner of the panel) and choose Make Work Path. We will receive a small dialog asking for a "Tolerance" in pixels. What's with that?

This relates to a dilemma we have when we try to convert a boundary in terms of pixels to a boundary in terms of mathematically-defined curves. Imagine that we made part of the selection boundary what we thought of as a straight line at an angle of 45° to the horizontal. Of course, if we examine the resulting mask at a sufficiently-high magnification, we will see a "stairstep" of one-pixel horizontal and vertical line segments.

Do we want the "vector" description of this boundary (the path) to follow the stairstep (with defining points at one-pixel intervals)? Probably not. We would probably prefer that it represent this part of the boundary with a single (straight) line segment (defined by only two points). There will of course be a similar issue for more complicated selection boundaries.

To tell the "path tracing engine" our desires about this, we basically say, "Ignore local jumps smaller than x pixels; they are just the manifestation of 'jaggies' ." We basically tell it "x" on this dialog.

When we OK this dialog, we see on the Paths panel a bar for our Work Path. The icon shows, as if for a mask, dark gray and white regions delineated by the path (white "inside").

We now must finalize this mask-in-process, making it a real mask. One way is to, on the Paths panel, bring down the menu and select "Save Path". A dialog invites us to give it a name. We OK that dialog, and now in the Paths panel we see a bar with our path, now having "real" status, labeled with that name. The Work Path is gone; it has been "saved as".

What can we do with a path

We can do several things with a path. For example, we can use it to define the border of a region to be filled with some color on a layer.

To do that, we select the layer and set the foreground color to the color we want to use. Then, on the Paths panel, we select path to be used, pull down the menu, and select Fill Path.

But our purpose here is to discuss another use to be made of a path.

Making the clipping path

Imagine that we plan to export a rectangular image to a page composition (publishing) application, but we want only an elliptical "clip" from it to finally appear, as a "cameo".

We can make a closed elliptical path through the steps described above.

We then (on the Layers panel) select the layer whose image is of interest, (on the Paths panel) select the path, and (on the menu of the Paths panel) select Clipping Path.

We now get a dialog that allows us to name the path we want to use (it will offer the name of the path we selected!) and invites us to choose a "flatness" for the path.

What's with that?

Although the path is described in terms of mathematically described curves (by which I mean including what we think of as "curved" curves), when the Postscript description of the final page is parsed by the Postscript interpreter to give the instructions to the Postscript printer, the curve is replaced by one comprising only (straight) line segments. The flatness parameter, "sent along with the path", essentially tells the Postscript interpreter how finely to divide the path curve into straight line segments.

We OK that dialog. We are done. There is an oval clipping path on our layer.

What we see

We might expect now to see our image with everything outside the region bounded by the path "invisible". But we don't - we see the entire image, and superimposed on it a thin black outline showing the clipping path.

The reason is that indeed we have not, in Photoshop, "clipped" or "masked" the image. We have merely prepared, to travel with the image, an instruction that says, "Sometime before the thing this ends up in is printed, block all the pixels that lie outside the region bounded by the curve that is described thus."

Can we watch this happening?

What if we don't have a Postscript-oriented printer, nor any Postscript-oriented page makeup application. Can we see that what I descried above really happens?

Yes. A way that many of us can use works in Microsoft Word.

With the clipping mask in place as described above, we export the Photoshop document as an EPS (Encapsulated Postscript) file.

We then import that into a Word document (we assume that the Word EPS translator is in place).

What we will see is our little elliptical "cameo". But if we click on it, we see that it is floating in an invisible "frame" exactly corresponding to the overall image. If we right click anywhere on this object, and select Format Picture, we can (on the Colors and Lines tab) choose a "fill color". This will fill all the background of the object (the scope of the original image) except where the "cameo" is.

A real mask

If we want, we can turn the description given by the clipping path into a genuine vector mask on some layer.

On the Layers panel, we select the layer of interest and, on the Paths panel, select the path of interest. Then, on the Masks panel, we click on the "Add a vector mask". A vector mask will be created on the layer, all "black" (opaque) except for the region enclosed by the path.

This will have the usual effect on the image of the layer: the portions in the opaque region of the mask will be invisible (actually having been made fully transparent).

Is this a handy way to make a vector mask from a selection? Certainly not, and we can do that in a much simpler way.

Why then might we want to go through the scenario I described? Beats me. I just wanted you to know what does what.

Best regards,

Doug
 

Asher Kelman

OPF Owner/Editor-in-Chief
Tiffany,

I edited your text as the first part said all that needs to be said!

Let’s continue our conversation privately so I can help best you.

Asher
 
Top