Version 2.0 of the format adds areas after the image data. They are found through a 26-byte footer at the very end of the file, and the rest can sit in any order. A file without the footer is an original-format TGA. Reading stops at the image data for those.
0Header18 bytes…Image ID, colour map and image datavaries…Developer area tags, optionalvaries…Extension area optional495 bytes…Scan-line table, postage stamp, colour correction optionalvariessize − 26Footer26 bytes
Extension area
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | size | 495 in version 2.0. |
| 2 | 41 | text | author name | Up to 40 characters, then a zero byte. |
| 43 | 324 | text | comments | Four lines of 80 characters, each ended by a zero byte. |
| 367 | 12 | 6 × u16 | date and time | Month, day, year, hour, minute and second. |
| 379 | 41 | text | job name | Up to 40 characters. |
| 420 | 6 | 3 × u16 | job time | Hours, minutes and seconds spent on the job. |
| 426 | 41 | text | software ID | The program that made the file. |
| 467 | 2 | u16 | software version | The version × 100, so 417 for 4.17. |
| 469 | 1 | ASCII | version letter | A letter following the version, or a space. |
| 470 | 4 | u32 | key colour | A:R:G:B, alpha in the top byte: the colour that means background. |
| 474 | 2 | u16 | pixel ratio numerator | A pixel’s width, as a fraction; 0 if not given. |
| 476 | 2 | u16 | pixel ratio denominator | 0 if not given. |
| 478 | 2 | u16 | gamma numerator | Gamma, as a fraction; 0 if not given. |
| 480 | 2 | u16 | gamma denominator | 0 if not given. |
| 482 | 4 | u32 | colour correction offset | Where the colour correction table is; 0 for none. |
| 486 | 4 | u32 | postage stamp offset | Where the postage stamp is; 0 for none. |
| 490 | 4 | u32 | scan-line offset | Where the scan-line table is; 0 for none. |
| 494 | 1 | u8 | attributes type | What the alpha bits hold: 0 none, 1 undefined and can be ignored, 2 undefined and should be kept, 3 useful alpha, 4 pre-multiplied alpha. 5 to 127 are reserved; 128 to 255 are unassigned. |
Developer directory
A 16-bit count, then ten bytes for each tag. It lets a program store data of its own and find it again. The format does not say what any tag means; a reader that does not know a tag skips it.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | tag number | 0 to 32,767 are for developers; 32,768 to 65,535 are reserved for Truevision. |
| 2 | 4 | u32 | offset | Where the tag’s data is in the file. |
| 6 | 4 | u32 | size | The size of the tag’s data. |
Postage stamp
A small copy of the image, at most 64 × 64 pixels, in the same pixel format as the main image: one byte of width, one of height, then its pixels. It is never compressed.
Colour correction table
A table of 256 entries of four 16-bit values, alpha, red, green and blue: 2,048 bytes in all. Values run from 0 to 65,535. The explorer shows where the table is but does not apply it to the picture.
Scan-line table
One 32-bit file offset for each row of the image, in the order the rows are stored. It lets a reader of a run-length encoded file jump straight to a row.