Prepare a map

The source image must be a .GIF file, with all places clearly defined and
colored (so, as .gif is limited to 256 colors, and 1 of them will be for
the sea, only 255 different domains may be drawn - more will not make the
script fail).

The source image can have any size (but the higher definition the better). No
transparency is used.

A good way to do it is :

Open an basic image of a map as a background layer in a multi-layer
image in your drawing tool

Resize it if needed

Create a second layer on it, fully white, and hide it for now.

Create a third layer, and, following the background, draw the
domains, one color for each. The color of the sea is the color of the very
first pixel (top left).