Difference between revisions of "Image file"
From Worms Knowledge Base
CyberShadow (Talk | contribs) (fixed) |
CyberShadow (Talk | contribs) m (added link for not so knowledgeable people) |
||
Line 18: | Line 18: | ||
== Flags == | == Flags == | ||
− | The flag byte is a | + | The flag byte is a [[w:Bit field|bit field]] of the following values: |
* 0x40 (01000000) - set if the image data is compressed | * 0x40 (01000000) - set if the image data is compressed | ||
* 0x80 (10000000) - the image has a palette | * 0x80 (10000000) - the image has a palette |
Revision as of 21:54, 21 November 2007
(Up to File formats)
Team17's image files (typically with an .img file extension) are usually compressed palleted images.
File format
- 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)
- if the image has a palette (highest flag bit is set):
- the image width (2 bytes)
- the image height (2 bytes)
- the image data. If the data is compressed (the corresponding image flag is set), see Team17 compression for the decompression routine; otherwise, it's just an array (Width × Height).
Flags
The flag byte is a bit field of the following values:
- 0x40 (01000000) - set if the image data is compressed
- 0x80 (10000000) - the image has a palette