Map regions.tga
The map_regions.tga is the map file that controls the borders of regions and determines city and port locations on the campaign map. Map_regions.tga will be found in the data/world/maps/base folder of a vanilla installation, it may also be placed in the data/world/maps/campaign/campaign_name folder if the other map files are copied there as well.
Fig1. Enlarged section of vanilla BI map_regions.tga
The location of cities is set by a one black (RGB = 0,0,0) pixel. The location of ports is set by one white (RGB = 255,255,255) pixel. There can be only one city and port per region.
Theoretically you can use any unique colour for a region, though some people have reported difficulties with specific colours. There is no agreed information as to whether any specific colours do not work - it is quite likely though that there could be a problem with using a colour that is very close to another.
Sea Colours
The majority of the sea colour in the vanilla map_regions.tga files is RGB 41,140,233 but the separated areas of sea (Caspian, Red and Dead Seas) have very slightly different colours. It is now thought that the difference in colours is necessary to prevent ships in the smaller separated seas trying to find paths to the larger sea area and getting 'stuck' along the coastline facing the bigger sea area. See here for discussion. However using different colours for the separated sea areas appears to reduce the number of regions you can have. The theoretical maximum number of provinces is 200 but it appears to work that:
total of (different coloured) sea areas + land regions = 200 regions max
Too Many Colours
When editing the map_regions.tga you must be very careful not to get merged colours - this will result in colours being present in the tga that are not assigned to water, city, port or known region as listed in descr_regions.txt. Merging can occur if you use wrong sort of re-size method, or wrong sort of 'brush'.