Adding thickness to a stencil map?

I’m wondering how I can use nodes to take a stencil map and add “thickness” to the stencil maps white colors, and make the thickness fade away like a gradient, for example this image is my “stencil”

but the image below is what I’m wanting to do:

Just wondering if this is possible to do in cycles.