Difference between revisions of "BTI (File Format)"
Jump to navigation
Jump to search
m |
(→Tools) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | '''BTI''' is | + | '''BTI''' is an image file format similar to [[TEX0]], [[TPL]] and [[BREFT]] file formats. The only difference is the file header. |
__TOC__ | __TOC__ | ||
− | == Appearance in | + | == Appearance in Mario Kart Wii == |
− | + | BTI files are used rarely in [[Mario Kart Wii]]. They can be found in some tracks with 3 different file names: | |
− | BTI files are used rarely in [[Mario Kart Wii]]. They can be found in some tracks | ||
* [http://szs.wiimm.de/cgi/mkw/track-ref/course.btienv#info course.btiEnv] | * [http://szs.wiimm.de/cgi/mkw/track-ref/course.btienv#info course.btiEnv] | ||
* [http://szs.wiimm.de/cgi/mkw/track-ref/course.btimat#info course.btiMat] | * [http://szs.wiimm.de/cgi/mkw/track-ref/course.btimat#info course.btiMat] | ||
Line 12: | Line 11: | ||
== File Format == | == File Format == | ||
− | + | The file format is very simple and starts with a file header followed by the image data. All data is written in [[big endian]]. | |
− | The file format is very simple | ||
− | |||
− | All data is [[big endian]]. | ||
=== File Header === | === File Header === | ||
− | + | The following table shows the file header. It is 0x20 bytes long. There is no magic to identify BTI files, | |
− | The following table shows the file header. It is 0x20 | ||
so tools may do some plausibility checks to identify them. | so tools may do some plausibility checks to identify them. | ||
Line 25: | Line 20: | ||
|+ File Header | |+ File Header | ||
|- | |- | ||
− | ! Offset | + | ! Offset !! Type !! Description |
− | ! | ||
− | ! Description | ||
|- | |- | ||
− | | 0x00 | + | | 0x00 || Byte || '''[[Image Formats|Image format]]'''. |
− | | | ||
− | | '''[[Image Formats|Image format]]'''. | ||
|- | |- | ||
− | | 0x01 | + | | 0x01 || Byte || '''Enable alpha''' (0x00 means alpha is disabled, anything higher means alpha is enabled). |
− | | | ||
− | | '''Enable alpha''' (0x00 means alpha is disabled, anything higher means alpha is enabled). | ||
|- | |- | ||
− | | 0x02 | + | | 0x02 || UInt16 || '''Width''' of the image in pixels. |
− | | | ||
− | | '''Width''' of image in pixels. | ||
|- | |- | ||
− | | 0x04 | + | | 0x04 || UInt16 || '''Height''' of the image in pixels. |
− | | | ||
− | | '''Height''' of image in pixels. | ||
|- | |- | ||
− | | 0x06 | + | | 0x06 || Byte || '''Wrap S'''[http://www.amnoid.de/gc/bti.txt] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for U projection maps. |
− | | | ||
− | | ''' | ||
|- | |- | ||
− | | 0x07 | + | | 0x07 || Byte || '''Wrap T'''[http://www.amnoid.de/gc/bti.txt] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for V projection maps. |
− | | | ||
− | | ''' | ||
|- | |- | ||
− | | 0x08 | + | | 0x08 || UInt16 || '''[[Image Formats#Palette_Formats|Palette format]]''' (not used in [[Mario Kart Wii]]). |
− | | | ||
− | | '''[[Image Formats#Palette_Formats|Palette | ||
|- | |- | ||
− | | | + | | 0x0A || UInt16 || '''Number of palette entries'''. |
− | | | ||
− | | '''Number of palette entries'''. | ||
|- | |- | ||
− | | | + | | 0x0C || UInt32 || '''Offset to [[#Image and Palette Data|palette data]]''', relative to the start of the file header. |
− | | | ||
− | | '''Offset | ||
|- | |- | ||
− | | 0x10 | + | | 0x10 || UInt32 || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. |
− | | | ||
− | | {{Unknown-left|'''Unknown'''.}} Always 0 in | ||
|- | |- | ||
− | | 0x14 | + | | 0x14 || Byte || '''Magnification filter type''' (0x00 means nearest, 0x01 means linear). |
− | | | ||
− | | '''Magnification filter type''' (0x00 means nearest, 0x01 means linear). | ||
|- | |- | ||
− | | 0x15 | + | | 0x15 || Byte || '''Minification filter type'''. |
− | | | ||
− | | '''Minification filter type'''. | ||
|- | |- | ||
− | | 0x16 | + | | 0x16 || UInt16 || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. |
− | | | ||
− | | {{Unknown-left|'''Unknown'''.}} Always 0 in | ||
|- | |- | ||
− | | 0x18 | + | | 0x18 || Byte || '''Total number of images''', thus number of mipmaps + 1. |
− | | | ||
− | | ''' | ||
|- | |- | ||
− | | 0x19 | + | | 0x19 || Byte || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. |
− | | | ||
− | | {{Unknown-left|'''Unknown'''.}} Always 0 in | ||
|- | |- | ||
− | | | + | | 0x1A || UInt16 || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. |
− | | | ||
− | | {{Unknown-left|'''Unknown'''.}} Always 0 in | ||
|- | |- | ||
− | | | + | | 0x1C || UInt32 || '''Offset to [[#Image and Palette Data|image data]]''', relative to the start of the file header. |
− | | | ||
− | | '''Offset | ||
|- | |- | ||
− | | 0x20 | + | | 0x20 || colspan=2 {{unknown|End of file header}} |
− | | colspan=2 {{unknown| | ||
|} | |} | ||
− | === Image and | + | === Image and Palette Data === |
− | |||
The image and palette data starts at the given data offset in the file header. | The image and palette data starts at the given data offset in the file header. | ||
The data depends on the image and palette formats format. | The data depends on the image and palette formats format. | ||
Line 111: | Line 68: | ||
== Tools == | == Tools == | ||
* [[SZS Modifier]] and [[CTools Pack]] support BTI images. | * [[SZS Modifier]] and [[CTools Pack]] support BTI images. | ||
− | * [[Wiimms SZS Tools]] can convert [[BREFT]], [[BTI]], [[TEX0]], [[TPL]] and [[PNG]] images in any directions. It may also convert the image and palette formats. | + | * [[Wexos's Toolbox]], by [[Wexos]] |
+ | * [[Wiimms SZS Tools]] can convert [[BREFT]], [[BTI]], [[TEX0]], [[TPL]] and [[PNG]] images in any directions. It may also convert the image and palette formats and add or remove [[mipmap]]s on the fly. | ||
− | [[Category:File Format]] | + | [[Category:File Format/Other]] |
Latest revision as of 17:10, 26 December 2018
BTI is an image file format similar to TEX0, TPL and BREFT file formats. The only difference is the file header.
Appearance in Mario Kart Wii
BTI files are used rarely in Mario Kart Wii. They can be found in some tracks with 3 different file names:
File Format
The file format is very simple and starts with a file header followed by the image data. All data is written in big endian.
File Header
The following table shows the file header. It is 0x20 bytes long. There is no magic to identify BTI files, so tools may do some plausibility checks to identify them.
Offset | Type | Description |
---|---|---|
0x00 | Byte | Image format. |
0x01 | Byte | Enable alpha (0x00 means alpha is disabled, anything higher means alpha is enabled). |
0x02 | UInt16 | Width of the image in pixels. |
0x04 | UInt16 | Height of the image in pixels. |
0x06 | Byte | Wrap S[1] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for U projection maps. |
0x07 | Byte | Wrap T[2] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for V projection maps. |
0x08 | UInt16 | Palette format (not used in Mario Kart Wii). |
0x0A | UInt16 | Number of palette entries. |
0x0C | UInt32 | Offset to palette data, relative to the start of the file header. |
0x10 | UInt32 | Unknown. Always 0 in Mario Kart Wii. |
0x14 | Byte | Magnification filter type (0x00 means nearest, 0x01 means linear). |
0x15 | Byte | Minification filter type. |
0x16 | UInt16 | Unknown. Always 0 in Mario Kart Wii. |
0x18 | Byte | Total number of images, thus number of mipmaps + 1. |
0x19 | Byte | Unknown. Always 0 in Mario Kart Wii. |
0x1A | UInt16 | Unknown. Always 0 in Mario Kart Wii. |
0x1C | UInt32 | Offset to image data, relative to the start of the file header. |
0x20 | End of file header |
Image and Palette Data
The image and palette data starts at the given data offset in the file header. The data depends on the image and palette formats format. The image format values are listed below.
ID | Name | Bits per pixel | Block width | Block height | Block size | Type |
---|---|---|---|---|---|---|
0x00 | I4 | 4 | 8 | 8 | 32 bytes | Gray |
0x01 | I8 | 8 | 8 | 4 | 32 bytes | Gray |
0x02 | IA4 | 8 | 8 | 4 | 32 bytes | Gray + Alpha |
0x03 | IA8 | 16 | 4 | 4 | 32 bytes | Gray + Alpha |
0x04 | RGB565 | 16 | 4 | 4 | 32 bytes | Color |
0x05 | RGB5A3 | 16 | 4 | 4 | 32 bytes | Color + Alpha |
0x06 | RGBA32 (RGBA8) | 32 | 4 | 4 | 64 bytes | Color + Alpha |
0x08 | C4 (CI4) | 4 | 8 | 8 | 32 bytes | Palette (IA8, RGB565, RGB5A3) |
0x09 | C8 (CI8) | 8 | 8 | 4 | 32 bytes | Palette (IA8, RGB565, RGB5A3) |
0x0A | C14X2 (CI14x2) | 16 | 4 | 4 | 32 bytes | Palette (IA8, RGB565, RGB5A3) |
0x0E | CMPR | 4 | 8 | 8 | 32 bytes | Color + optional Alpha (compressed) |
Tools
- SZS Modifier and CTools Pack support BTI images.
- Wexos's Toolbox, by Wexos
- Wiimms SZS Tools can convert BREFT, BTI, TEX0, TPL and PNG images in any directions. It may also convert the image and palette formats and add or remove mipmaps on the fly.