Build-a-map - beta
Here is a small non-interactive tool to create a high definition
beautiful image of a map, in PHP, from a standard source image.
This result should fit for printing for table games, or used in video games.
Features
- Source correction (pixelisation, noise)
- High definition (and beautification) with multiple bicubic interpolation
and supersampling
- Mercator projection to equidistance correction (if needed)
- Free, open-source, and with support on demand
Download
Download here
This script is under GPL
See a sample result on the right =====>
How to
Needed
- A web server supporting PHP 5. A lot of free and easy web-server for
Windows are available, e.g. :
EasyPHP, WAMP...
- A drawing tool supporting layers, e.g. Gimp,
Paint.net...
- About 1h of work
- 1 to 10 hours for computation
Proposed methodology to use it :
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).
- Show the second layer.
- Save it (as a copy) as a .GIF file.
The result should be like the image on the right
Run the script
- Put the PHP script in the root folder (or "webfolder") of your web
server.
- Test it, the address should be like :
http://localhost/buildmap/buildamap.php.
- Verify that result.png has been created (and there are no php
errors).
- Put you source .GIF image next the script.
- Open the script (any notepad will fit), and change the options in the
beginning. You should particulary increase "OUT_TX" and "OUT_TY"
(pixels). Don't use already a very high value (eg. 3000 * 2000).
- Launch it (always the same address above). It should be a lot slower
if you increase "OUT-TX", "OUT-TY" or "MLT".
- Ajust...
Use the map
You should end your work by painting items, stamps... on your map, using
any drawing tool.
Help !
Ask for any help, or propose modification here.
askywhale, 2009