Author Topic: Stroke a mask or vector shape.  (Read 2223 times)

In photoshop I often use the stroke option in the layer options. You can use it based off of the trasparency of the layer mask or with the use of a vector mask. I would really love this functionality in both painter and designer. Please forgive me if this is already possible as I am still learning the software.

Hehe, I was wondering exactly the same :)
So far, I found a small workaround creating a simple substance:
- First I blur the grayscale image (the alpha in photoshop)... the radius of the blur will define the radius of the stroke.
- Then I feed the blurred image to 8 emboss filters (with black bg color), one every 45degrees.
- Finally I combine this 8 filters with a blend node set to "Add", eventually blurring the result if it is too noisy.

It is FAR from a perfect solution, as edges will be a bit jagged. So if you need a clean stroke, this will not work.
But hey, it may do the job if you need a blurred stroke :)

Hey Nick,

Is this what you wanted or does the stroke need to be on both sides of the line?  This was a quick try below.

Got it working with both inner and outer strokes.  Can adjust individually.  Let me know if that is what you were trying to achieve.

Last Edit: August 14, 2014, 01:35:55 pm

Nice one artfx!
Even though I believe the stroke effect must be a clean outline.

Here my substance:

There are 3 different graphs:
Contour Clean and Contour Fast are based on the emboss filter. They have some more parameters and can produce a clean stroke... with the problem that the radius can't go after a certain amount (the maximum amount is one, but is not a value in pixels).
"Contour" instead has a radius parameter only, which is specified in pixels and so can produce very thick strokes. It basically blurs the image and contrasts it a lot to obtain the effect. It can produce jagged edges with thick strokes, but hey, it's up to you :)

I would like to study better the "Shadows" substance that comes with Designer, maybe there is a way to produce even cleaner results!

P.S. Btw, I would use "Contour"... the other two where just my first tries :D
Last Edit: August 14, 2014, 03:44:16 pm

I understand what you were seeking now.  That's some clever graphs you made to achieve he effect.

Thanks for showing this. Sorry I haven't checked my account in awhile. I need to change my settings to email notify when I get replys to my threads. So this can work. I am looking for a nice clean line. The line is clean on one edge but soft on the other.

Hi there, I updated the stroke script.

It is a modified version of the Dilation filter that you can find here.

It contains "dilation_grayscale", similar to Expand Selection in Photoshop, and "stroke_grayscale".
It is slow, but the edges are uber clean.

In the case of the stroke effect, I need to modify it to accept real pixels... currently the radius value is actually doubled.


Thanks Mario.Baldi!!

Hey guys, most of the links in this thread are dead, can I possibly have any of the stroke filters (especially with the inner stroke)?