Create mask based on texture values

try using a texture cropping node.
Define the upper left and lower right corners and multiply the ‘crop mask’ output with the image.