I use ZBrush, I don't know if Blender can do this. The steps I use are import the image into ZB, there are several ways to use these images. These 2 examples are made from a flat plane polymesh, I import the image as a texture map, then I use mask by intensity, a function that mask the mesh similar to the image. I can then turn off the texture map to view the mask. To modify the mesh I resized on the axis that faces the mask. The mask controls how much resizing will be done to the mesh along the axis selected. Black is totally protected, white is free to move unprotected, the various shades of gray are restricted from movement, lighter = less protection, Darker = more protection.