Here's another variation on painting the edges of a layer maskautomatic painting, thanks to a path. As before, we'll create a copy of the image and add a layer mask, but then we'll create and use a path to do the work for us.
Press Command-J (PC: Control-J) to duplicate the Background layer.
From the Image menu, choose Canvas Size (or press Command-Option-C [PC: Control-Alt-C]). In the Canvas Size dialog, make sure the Relative checkbox is turned on and enter 1 inch in both the Width and Height fields.
Press-and-hold the Command key (PC: Control key) and click on the Create a New Layer icon at the bottom of the Layers palette to create a new layer below the current layer. Press D to set your Foreground and Background to the default colors. Then press Command-Delete (PC: Control-Backspace) to fill the new layer with white.
As in the previous technique, we'll make a selection by choosing the Rectangular Marquee tool (M) and clicking-and-dragging to create a selection that leaves a small border (rather than using Modify>Contract).
Make sure that the top layer is active and click on the Add Layer Mask icon at the bottom of the Layers palette to create a layer mask from your selection.
Press-and-hold the Command key (PC: Control key) and click on the layer mask thumbnail to make a selection the same size as the mask. Then, switch to the Paths palette (nested behind the Layers palette by default) and from the palette's flyout menu, choose Make Work Path. In the resulting dialog, enter a Tolerance of 0.5 pixels (the lowest number possible, creating a more accurate path).
A path will now be visible around the edges of the photo. This path is a non-printing element that is used for various purposes such as making a selection, or as we'll use it here, to apply a stroke.
Choose the Brush tool (B) and in the Options Bar enter the settings you want to useparticularly choosing the brush and setting the opacity. As in all the exercises, you can experiment with many different settings here. Note: Make sure your Foreground color is set to black by pressing D.
In the Layers palette, make sure that the layer mask is active, and then switch back to the Paths palette. Make sure the path is active (indicated by the fact that the Work Path is highlighted in the palette), press-and-hold the Option key (PC: Alt key), and click on the Stroke Path with Brush icon at the bottom of the palette (the second icon from the left). In the Stroke Path dialog, make sure Brush is selected in the Tool pop-up menu. Here's the result based upon the brush and opacity settings I chose in Step Seven.
Another option is to turn on the Simulate Pressure checkbox in the Stroke Path dialog. Here's an example, created by using a different brush and simulating pressure.