1

In Adobe Photoshop there is a layer style named Stroke. You can set its Position to Inside.

enter image description here

Is there a way to use an alpha-channel multiplier instead of a solid color? I'd like to make the layer edge (say, 7 pixels) semi-transparent with a given level of opacity (say, 80%):

enter image description here

0

2 Answers 2

2

No such functionality as one click mode selection. Here's a workaround:

enter image description here

The ball is yours or actually the solid part of your ball. I made few pixels wide zone at the edge transparent by adding a layer mask. In the mask black means full transparent, grey means partially transparent and white means fully opaque. The mask is this:

enter image description here

The gradient background is there only to show the transparency near the edge.

Your stroke can well be used to make the selection for the area where to darken the full white layer mask. As well one can use selection contraction.

Useful to remember: You can 1) create a layer mask along a selection by having a selection ON when clicking insert layer mask. 2) select the non-transparent area of a layer by doing Ctrl+Click on the layer icon in the Layers panel 3) convert layer styles to separate layers, also the stroke 4) Take the layer mask under on-screen edits by doing Alt+Click on the layer mask icon.

1
  • I think I've got the idea: use the Stroke style as a selection area, draw the mask, fill it with lighter or darker gray. Commented Oct 9, 2022 at 7:39
1

@user287001's answer is probably the simplest way to do what you want. The problem with it is that both the offset and the opacity are baked into the mask. I want to show that there is a 100% dynamic solution.

(I'm using Photoshop 2022, but I think this method should be possible in Photoshop CS6 as well.)

Method

  • Convert the layer to a Smart Object.

  • Make two duplicates of the layer.

  • Wrap the topmost layer in a group.

  • Wrap that group and the layer below in another group.

  • Add a Stroke effect to the topmost layer. Make sure to set Position to Center and set the Size to twice the offset you want.

  • Enter the topmost layer's Blending Options. Set Fill Opacity to 0% and press OK.

  • Enter the inner group's Blending Options. Set Fill Opacity to 0% and Knockout to Shallow.

Now you can change the opacity of the edge by changing the opacity of the bottommost layer and you can change the offset by changing the stroke width of the topmost layer.

If you enter one of the Smart Objects (which all point to the same image) and change the transparency of the original image, the edge will update accordingly.

The downside of this method is that it looks a bit messy in the Layers panel and can be hard to understand for other people opening your document.

Explanation

Let me try to explain what's going on. It's a bit convoluted.

The topmost layer is used to create a stroke that follows the opacity of the original image, but without the image itself. That's why we set the Fill Opacity to 0%.

Then we need to subtract that stroke from the original image. For that we can use knockout. But it won't work directly on layer effects, so we need to apply the knockout to a group around the layer with a stroke.

Turning on Knockout will knock a hole in whatever lies below. The hole isn't visible unless you set Fill Opacity to 0%. The Shallow setting will confine the knockout to the group the layer or group is in. That's why we wrap the group with knockout with a duplicate of the layer in another group. To stop the knockout there, so we don't remove the edge from the bottommost layer.

The bottommost layer is of course needed to render the edge itself.

2
  • 1
    Thank you very much for so detailed answer. Unfortunately, my upvotes aren't considered yet as I'm a newbie. Commented Oct 9, 2022 at 14:16
  • @Shtole, you're welcome! Commented Oct 9, 2022 at 22:44

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.