Image file
From Worms Knowledge Base
Revision as of 00:20, 30 June 2020 by Pac-Man (Talk | contribs) (Create table from file format specification.)
(Up to File formats)
Team17's image files (typically with an .img file extension) are usually compressed palleted images.
File format
Game | Type | Size | Name | Description |
---|---|---|---|---|
![]() ![]() ![]() |
uint8[4] | 4 | Signature | Always "IMG\x1A". |
![]() ![]() ![]() |
uint32 | 4 | File Size | Complete length of the file, in bytes. |
![]() ![]() ![]() |
string0 | - | Description | An optional, null-terminated string, only present in some Worms 2 images. |
![]() ![]() ![]() |
uint8 | 1 | Bits Per Pixel | Usually 8 (256 colors). |
![]() ![]() ![]() |
uint8 | 1 | Image Flags | A bit field of the following values:
|
![]() ![]() ![]() |
uint16 | 2 | Palette Color Count | Only if palletized, excludes black[1]. |
![]() ![]() ![]() |
rgb[colorCount] | 3 × color count | Palette Colors | Only if palletized, excludes black[1]. 3 bytes each color (RGB). |
![]() ![]() ![]() |
uint16 | 2 | Image Width | In pixels. |
![]() ![]() ![]() |
uint16 | 2 | Image Height | In pixels. |
![]() ![]() ![]() |
uint8[] | - | Image Data | Raw image data, according to the above[2]. |
- ↑ Jump up to: 1.0 1.1 The black colour isn't listed in the image palette, nor counted in the "number of colours" word. It is counted as the colour 0, so the palette stored in the file should be loaded starting from colour 1.
- Jump up ↑ Embedded images in WWP land.dat files align their data by 4 bytes.