Difference between revisions of "Image file"
From Worms Knowledge Base
CyberShadow (Talk | contribs) m (removing categories) |
(Add OW and WWPA icons. Display possible alignment in table.) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
== File format == | == File format == | ||
− | + | {| class="wikitable" | |
− | + | ! Game !! Type !! Size !! Name !! Description | |
− | + | |- | |
− | + | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint8[4] || 4 || Signature || Always "IMG\x1A". | |
− | * | + | |- |
− | * | + | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint32 || 4 || File Size || Complete length of the file, in bytes. |
− | + | |- | |
− | + | | {{SoftwareEx|W2|OW}} || string0 || - || Description || An optional, null-terminated string, only present in some [[Worms 2]] and [[Online Worms]] images. | |
− | + | |- | |
− | + | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint8 || 1 || Bits Per Pixel || Usually 8 (256 colors). | |
− | + | |- | |
− | + | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint8 || 1 || Image Flags || A [[w:Bit field|bit field]] of the following values: | |
− | + | * 1 << 6 (0x40) = Image data is [[Team17 compression|compressed]]; otherwise, it is an array of Width × Height pixels. | |
− | + | * 1 << 7 (0x80) = Image has a palette, defined as follows: | |
− | + | |- style="background:#EEE" | |
− | + | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint16 || 2 || Palette Color Count || Only if palletized, excludes black<ref name=Black>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.</ref>. | |
− | + | |- style="background:#EEE" | |
− | + | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || rgb[colorCount] || 3 × color count || Palette Colors || Only if palletized, excludes black<ref name=Black/>. 3 bytes each color (RGB). | |
+ | |- | ||
+ | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint16 || 2 || Image Width || In pixels. | ||
+ | |- | ||
+ | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint16 || 2 || Image Height || In pixels. | ||
+ | |- style="background:#EEE" | ||
+ | | {{SoftwareEx|WWP|WWPA}} || align4 || - || Alignment || Only when embedded in [[Land Data file|land.dat files]], aligns to the next 4-byte boundary. | ||
+ | |- | ||
+ | | {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || uint8[] || - || Image Data || Raw image data, according to the above. | ||
+ | |} | ||
<references /> | <references /> |
Latest revision as of 20:14, 30 June 2020
(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 and Online Worms 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. | |
align4 | - | Alignment | Only when embedded in land.dat files, aligns to the next 4-byte boundary. | |
uint8[] | - | Image Data | Raw image data, according to the above. |