I want to create a game, where the world is loaded from an image file, much like Paradox Interactive does it for their games. If I have this image:

![](https://i.stack.imgur.com/T4QTm.png)

Then the red, green, blue, cyan, magenta, white, black and grey should be different provinces. I know how to loop through them, and check if it's a new province, the problem is that I don't know how to define the region of the province for selection: I don't know how I can load in data, to make sure you can click anywhere on that province, and make sure it gets selected.