TXTR (File Format)

From Wexos's Wiki
Jump to navigationJump to search

TXTR (TeXTuRe) is a texture file format stores as subfiles in PAK files. It is used in games like Donkey Kong Country Returns and developed by RetroStudios.

File Format

Header

The file starts with a header of size 0x0C:

Offset Type Description
0x00 UInt32 Image format. See here for details.
0x04 UInt16 Width of image in pixels.
0x06 UInt16 Height of image in pixels.
0x08 UInt32 Number of mipmaps, including main image.

Palette

If the image format is a palette format, in other words C4, C8 or C14X2, the following structure follows the header:

Offset Type Description
0x00 UInt32 Palette format. See here for details.
0x04 UInt16 Palette width (?). Always 1 for C4, 256 for C8.
0x06 UInt16 Palette height (?). Always 16 for C4, 1 for C8.

The palette data follows.

Image Data

The image data follows the header, or the palette data if palettes exist.

Image Formats

The following image formats are available:

Image Formats
ID Name Bits per pixel
0x00 I4 4
0x01 I8 8
0x02 IA4 8
0x03 IA8 16
0x04 C4 4
0x05 C8 8
0x06 C14X2 16
0x07 RGB565 16
0x08 RGB5A3 16
0x09 RGBA8 32
0x0A CMPR 4

The following palette formats are available:

Palette Formats
ID Name Bits per palette
0x00 IA8 16
0x01 RGB565 16
0x02 RGB5A3 16

Tools

The following tools can handle TXTR files: