# How to dilate binary image from outside-to-inside?

I have a binary image of a line, like this one:

What I'd like to do is to dilate the line, but only towards the 'inside' of the line. That is, to add white pixels towards the center of the image, using DiskMatrix[] or any other kernel of a given radius/size. I've been trying to find ways to do this for a bit but I have no idea where/how to begin.

Thanks!

• WatershedComponents[img]//Colorize//Binarize Mar 8, 2021 at 5:04
• @b3m2a1 yeah, this works by filling the entire 'inside'. But what I really want is to control how much does it fill, that's why I mentioned the kernel size. Thanks! Mar 8, 2021 at 5:27
• Ah you can use Dilation as usual and use that as a mask to clip off anything outside, e.g. Dilation[woof, 50]*mask will give you a nice result if woof is the OG image and mask is what comes out of that Mar 8, 2021 at 5:28
• Hmm. I see. If you add it as an answer I can accept it. Mar 8, 2021 at 5:29

Because the Manipulate is fun:
woof = Import["https://i.stack.imgur.com/JKnlk.png"];

Manipulate[Dilation[Binarize@woof, i]*mask, {i, 1, 100}]