BFLIM (File Format)

From MK8
Revision as of 22:07, 1 December 2016 by Ink Larry (Talk | contribs)

Jump to: navigation, search

The BFLIM file format is used to store layout images.

Parsing information


The header is, for whatever reason, at the end of the file. It is always 0x14 bytes.

Offset Size Description
0x00 4 "FLIM" File Identifier, ASCII string.
0x04 2 Byte order mark (BOM): 0xFE,0xFF for big endian and 0xFF,0xFE for little endian.
0x06 2 Header size, always 0x14.
0x08 4 Unknown, usually 0x03030000 or 0x02020000.
0x0C 4 Filesize
0x10 2 Unknown, always 0x01.
0x12 1 Multiplier?, always upper 2 bytes of filesize.
0x13 1 Unknown, always 0.

Data Information

Comes directly after header, always 0x14 bytes. Formats not the same in games like NSMBU, be sure to use filename if possible (EG: ^l).

Offset Size Description
0x14 4 "imag", some signature, ASCII string.
0x18 4 Parse information size, always 0x10 (this and next 0xC bytes).
0x1C 2 Width
0x1E 2 Height
0x20 2 Alignment usually 0x800 (2048) or 0x1000 (4096)
0x22 1 Format, how the data is stored.
0x23 1 Swizzle, first nibble is swizzle times two (2 is 1, 4 is 2, etc), second seems to always 4
0x24 4 Raw data size, always 0xC minus 0x28 (the header).


ID Name Type Bits per pixel Notes
0x00 R8_UNORM single-color 8 ^c BFLIM files
0x01 R8_UNORM single-color 8 ^d BFLIM files
0x03 R8_G8_UNORM 16 ^f BFLIM files
0x05 RGB565 color ^h BFLIM files
0x0C BC1_UNORM / DXT1 16 ^i BFLIM files
0x0E BC3_UNORM / DXT5 16 ^k BFLIM files
0x0F I4? / BC4_UNORM / ATI1 (Low-End) grey ^r BFLIM files
0x10 IA4? / BC4_UNORM / ATI (High-End) color+alpha ^s BFLIM files
0x11 I8? / BC5_UNORM / ATI2 color ^t BFLIM files
0x12 IA8? color+alpha
0x14 RGBA32_UNORM / RGBA8888 color+alpha 32 ^l BFLIM files
0x15 BC1_UNORM / DXT1 Compressed 32 ^o BFLIM files
0x16 BC2_UNORM / DXT3 Compressed 32 ^p BFLIM files
0x17 BC3_UNORM / DXT5 Compressed 32 ^q BFLIM files
^e BFLIM files


The following tools can extract (and generate) BFLIM files: