imf form defines graphical images in a platform-independent
way. An image family is a named collection of images of varying
sizes and depths.
imf name [ properties ] [ images ]
This form declares an image family to exist, with the name name and properties, and consisting of the specified images. Each image has the form
((w h special) [ properties ] (type data...) ...)
where w and h are its width and height, respectively,
special indicates special characteristics of the image, the
type may be one of
file, and the data consists of strings of hexadecimal
digits. The data strings may include slashes, which have no effect on
interpretation, but are useful to indicate each row of an image. Color
images may also have additional properties, which come between the
type and the data.
The family's name may consist only of alphabetic characters, decimal digits, and hyphens or underscores. Upper- and lower-case characters are equivalent, as are hyphens and underscores. The canonical form of the name is lowercase with hyphens.
Multiple forms with the same name may occur, and each adds to the family, overwriting individual image parts that are of the same size and depth.
If this symbol appears following the dimensions of an image, it indicates that the image is a pattern tile rather than a single image.
If this symbol appears following the dimensions of an image, it indicates that the image is a set of images for border terrain. Borders have 16 subimages, each showing a different sort of junction between cells.
If this symbol appears following the dimensions of an image, it indicates that the image is a set of images for connection terrain. Connections have 64 subimages, each for a different pattern of connectons to adjacent cells.
This symbol indicates that the terrain is a transition pattern used to blend two types of terrain. Transitions consist of at least 4 subimages, and may have several variants that can be chosen randomly.
actual w h
This property is the actual size of the image data.
This property specifies that another image, similar to the image family named by name, is already embedded within the image, and so Xconq need not superimpose such an image itself. This may occur when an image has a "builtin" side emblem, or is readily identifiable as belonging to a particular side, and it would be redundant for Xconq to add an emblem when displaying a unit.
embed-at x y
This property specifies that the area of the image at x,y is suitable for the display of an emblem.
embed-size w h
This property specifies the dimensions of the area available for an emblem.
x n [ x y ]
This property specifies that the image includes n variant subimages, any of which may be randomly chosen by an interface. The optional numbers x and y indicate the offset of each subimage, so for instance an x of 32 and a y of 0 indicates a horizontal strip of images, each 32 pixels apart. Their values default to the width of the image and 0, respectively.
This property is for designer notes about the image.
mono data ...
This property indicates that the data represents a monochrome image.
mask data ...
This property indicates that the data represents a mask.
color [ properties ] data ...
This property indicates that the data represents a color image.
This property is the number of bits used to encode each pixel.
palette [ (index r g b) ... ]
This property is the color palette that should be used with the image.
file filename [
std ] [ x y ]
This property indicates that the image data is in a file named filename. filename must contain a recognized type of image (GIF only, at present). The optional x and y indicate the position of the upper left corner of the image within the larger picture contained in the file.
If the optional symbol
std precedes the position values, then the
numbers are relative positions in a file image that is assumed to be a
grid of images all the same size. It is also assumed that images are
separated by two pixels on all sides, so the pixel position is
(x * (img_width + 2)).
File images do not have explicit masks, but may instead have key colors that will be used to compute the mask. Key colors are indicated by 2x2 pixel blocks in the upper left corner of the file image. Any number of key colors may be defined; the end of the list is indicated by a block of the same color as the first block. (See `images/river44x48.gif' for an example with many key colors.)
This symbol, when in a
file property, indicates that the
file image is laid out in a standard grid pattern. (see above)
Note that for the purposes of stability and change tracking, tools that generate image families use a more restricted format. This format requires a separate imf form for each size of image, the size is on the same line as the imf name, and each image/mask is on a separate line, indented by 2. (See the existing library imf files for further detail.)