L3DT users' wiki
Large 3D terrain generator

 

atImportAM

Plugin information

Author Aaron
Formats PNG, BMP, MMF (import only)
Download link Included with L3DT v2.9 build 9 and later.
Last update v2.9.5.1, 20th of Feb 2011, released with L3DT Pro v2.9 build 10.
Dependencies L3DTio_FI, L3DTio_BigBitmap, L3DTio_Backup, ZeoScript

Using atImportAM

Import from colour map

To import an attributes map from a colour image file, select the 'File→Import→Attributes map→Import from colour map' menu option. This will open a file window with which you can select the image file to load.

The attributes map importer supports bitmap, PNG and mosaic file formats. It deliberately does not support lossy compression formats such as JPG or DDS, since these formats introduce additional (unintended) colours into the image.

Once you have selected the file you wish to load, L3DT will load the image file and analyse it to create a colour palette in the map. Once the analysis is complete, L3DT will ask you to specify the land types that correspond to each colour using the land type colour table window shown below:

Assigning land types to colours

If the colours in the map correspond to the display colours of existing climate/land types, L3DT will automatically populate the list with land types for each colour (as shown above).

If a colour in the image does not match an existing land type, the colour will have no automatically associated land type, so the user (i.e. you) will have to manually select the land type. To select a climate or land type, simply click in the relevant cell of the table to open a drop-list of available climates / land types, as shown below:

Selecting a climate Selecting a land type

Once you have assigned the land types for each colour and click OK, L3DT will then ask if you want to save the colour palette for later use. If you click 'yes', L3DT will ask you for the file name for the palette text file, and save the file (see examples below). Thereafter, L3DT will proceed to convert the colour map into the attributes map.

Import from colour map with palette file

To import an attributes map from a colour image file using an existing colour palette, select the 'File→Import→Attributes map→Import from colour map with palette file' menu option. This will open a file window with which you can select the image file to load.

Once you have selected the file you wish to load, L3DT will ask your for the file name of the colour palette text file (*.txt). This file should have previously been created by L3DT when exporting the attributes map or when using the colour table window described above. The format of the palette file is described below.

Once you click OK in the file selector window, L3DT will load the image and the colour palette and begin generating the attributes map.

Colour palettes

Colour palette files are plain text files (.txt) that list the colours associated with land types.

These files are used with the 'File→Import→Attributes map→Import from colour map with palette file' menu option. This option allows the user to import an attributes map without having to manually specify which colours go with which land types using the land type colour table window described above.

Colour palette text files are automatically created when exporting the attributes map as a PNG image file, and also when importing an attributes map from a colour map using the land type colour table via the 'File→Import→Attributes map→Import from colour map' menu option.

The format of a colour palette file is a simple five-column comma separated value file giving the RGB colour coordinates (0…255) corresponding to each land type and climate. An example is provided below:

R, G, B, Climate, Land type
230, 230, 120, "Temperate", "Sand",
175, 161, 131, "Temperate", "Pebbles (2)",
120, 121, 120, "Temperate", "Underwater rock",
120, 122, 122, "Temperate", "Coastal rock",
140, 195, 80, "Temperate", "Grass",
140, 185, 70, "Temperate", "Steep grass",
120, 190, 80, "Temperate", "Lush grass",
110, 180, 80, "Temperate", "Steep lush grass",
110, 190, 80, "Temperate", "Steep lush grass (2)",
150, 180, 80, "Temperate", "Steep dry grass (2)",
120, 120, 120, "Temperate", "Cliff face",
80, 80, 80, "Temperate", "Steep cliffs",

The colour palette is also automatically exported as a HTML file, which may be easier for humans to read when viewed in a suitable browser. An example HTML file, corresponding to the palette text file above, is available here.

Notes

Unassigned colours

If a colour in the land type colour table does not have an assigned climate/land type, then when the colour map is imported and converted to the attributes map, pixels containing the unassigned colour(s) will be set to a value of 'invalid land type' in the attributes map (code 0).

If you are importing a colour map over an existing attributes map, all such pixels with unassigned colours will not be applied to the attributes map. Thus, if you wish to import a road, for example, you should include only the colour of the road in the colour table palette, and leave all other colours unassigned. This will 'mask out' all other features in the colour map, and import only the road.

Changes

2011/02/20

  • Released v2.9.5.1, with L3DT 2.9 build 10.
  • Added support for loading / saving colour palettes.

2011/02/17

  • Released v2.9.5.0, with L3DT 2.9 build 9.
 
plugins/fileio/atimportam.txt · Last modified: 2017/08/31 04:30 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki