TXTR (Metroid Prime)

See TXTR (File Format) for the other revisions of this format.

TXTR is, as the name suggests, the Retro Studios texture format. The format remains completely unchanged from Metroid Prime all the way up to Donkey Kong Country Returns.

Format
TXTR files contain a very short 12-byte header, followed by the image data.

Palettes
The C4 and C8 image formats contain a palette table after the header, before the image data begins.

Image Formats
There are 11 different image formats supported by the hardware. Rather than storing pixels in a linear left-to-right order, GameCube textures are swizzled in blocks. Blocks are 32 bytes large (except for RGBA8), with their dimensions varying depending on the BPP of the image format.

For example, suppose you have a format that stores 4x4 blocks. Pixels 1-4 of the image will make up the first row of the first block; pixels 5-8 will make up the second row; 9-12 will make up the third row; 13-16 will make up the fourth row, completing the block; and then 17-20 will begin the first row of the second block, appearing directly to the right of the first row of the first block.