you could try using compound blur (which will blur based on the luminance or lightness of another layer) and then levels or curves to compress just the alpha values to tighten the blurred edges. the result should vary the stroke width based on the luminance of the other layer, at least to some degree.
if you wanted the stroke to write-on with a variable weight, the you could use the write-on effect, copying/pasting the mask path into the brush position and then using a sampleImage() expression to drive the brush size. the expression would look something like this:
map = thisComp.layer("image map"); // this would be your image map layer
size = 20; // use this to adjust the overall thickness of the line
map.sampleImage(effect("Write-on")("Brush Position"), radius = [.5, .5], postEffect = true, t = time)[0]*size
you’ll also need to set the brush time property to ‘size’.
note, the expression assumes that the image map is the same size and position as the layer that the write-on effect is applied to.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW