Difference between revisions of "Image file"
From Worms Knowledge Base
CyberShadow (Talk | contribs) |
CyberShadow (Talk | contribs) |
||
Line 9: | Line 9: | ||
* image flags (1 byte) | * image flags (1 byte) | ||
* the number of colours in the image palette, excluding black<ref name=Black>The black colour isn't listed in the image palette, nor counted in the "number of corours" word. It is counted as the colour 0, so the palette stored in the file should be loaded starting from colour 1.</ref> (2 bytes) | * the number of colours in the image palette, excluding black<ref name=Black>The black colour isn't listed in the image palette, nor counted in the "number of corours" word. It is counted as the colour 0, so the palette stored in the file should be loaded starting from colour 1.</ref> (2 bytes) | ||
− | * the image palette, excluding black<ref name=Black> ((3 * number of colours) bytes) | + | * the image palette, excluding black<ref name=Black/> ((3 * number of colours) bytes) |
* the image width (2 bytes) | * the image width (2 bytes) | ||
* the image height (2 bytes) | * the image height (2 bytes) |
Revision as of 00:49, 5 July 2006
Team17's image files (typically with an .img file extension) are usually compressed palleted images.
File format is as follows:
- 4-byte signature - "IMG\x1A"
- complete file length (4 bytes)
- optionally, a null-terminated string describing the image (present only in some Worms 2 images)
- the number of bits per pixel in the image (usually 8) (1 byte)
- image flags (1 byte)
- the number of colours in the image palette, excluding black[1] (2 bytes)
- the image palette, excluding black[1] ((3 * number of colours) bytes)
- the image width (2 bytes)
- the image height (2 bytes)