I’ve got a tool on the marketplace (rdTexTools) that can create Signed Distance Fields from your texture - here’s a link to a tutorial - it’s more about using them to store textures in a small resolution, but the concept is the same.
The tool creates the mask with the edge at a value of 0.5, so you can also change the outline to be inside the masked area if you wish. (There are other ways of creating the distance fields, a google search should find them)
Something like this material is all you need to do: