Possible to select geo based on value of mapped texture?

This is a tricky trick that I can’t quite puzzle…

If I have a simple greyscale image mapped to an object via UV… can you think of a way to select the faces or verts that coincide with pixels of a certain value or threshold?

In a simple test case, I’ve mapped a black and white image of the world land masses to an icosophere and I want to select all the verts that fall within the land masses, represented in the texture by black (white being water.)

Any ideas?

I think that will require some fairly nifty Python scripting to grab the image data and correlate it with the mesh data.

I conquered it…

Create empty vertex group.

Add a Vertex Weight Edit modifier.

Assign texture and UV to modifier.

Assign vertex group to modifier.

Enable “Add to Group”

Finagle the thresholds to get the value range you want.

Apply modifier.

The vertex group now contains the verts assigned the weights from the modifier, which can be used as a selection set.