News:

11 March 2016 - Forum Rules

Main Menu

Weird BMP format?

Started by Dashman, July 01, 2014, 08:09:28 PM

Previous topic - Next topic

Dashman

I've run into these files that hint heavily at containing bitmap images (they originally had no extension, I saved them as BM for clarity). The header seems to be 32 bytes long and this is its likely structure:

bytes 0 - 2: "BMP".
byte 3: unknown. either 06 or 09.
bytes 4 - 7: number of colours (?)
bytes 8 - 11: height.
bytes 12 - 15: width.
bytes 16 - 31: all zeroes.

Values are big endian. The rest of the file would be the image data. Here are some examples:

https://www.dropbox.com/sh/ieiibbxvef61vwc/AACuO9Jx-E409qiVftPM414va

I've tried looking at the graphics data in the files with crystaltile (after changing the extension to .bin), but they appear to be garbage no matter the mode I choose. Has anybody run into a similar format before?

Some files (0018.BM in the folder) have byte 3 set to 07 and both height and width set to 0. These could be palette files.

There's other files (0007.BM in the folder) whose byte 3 is set to 0a. The size in the bitmap data of these files is not height * width unless we assume 6bpp, which is a pretty unusual colour format (at least for me).

Any thoughts or suggestions?

Jorpho

Did they come from a reliable source (as opposed to, say, a decaying floppy disk) ?
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

KC

I assume this is from the GameCube game you are hacking. These obviously aren't bitmaps like Microsoft uses them. Those don't start with BMP anyway.
Check if the image data is in any of these formats: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/TextureDecoder_Generic.cpp#L631
Probably I8 or C8, whatever the difference.

Dashman

#3
Kingcom is right, these are all extracted from a .bin file inside a working Gamecube ISO using a custom tool.

The file is packed with graphics files (namely SPR files containing backgrounds) among others, so I'm inclined to believe these BMP files are proper image files with a funny format.

I imagine corrupted image data would look wrong around specific sections of the image, rather than the whole thing looking like pixel confetti. Then again, I've never run into something like that.

I was wondering if Dolphin's code wouldn't have something to deal with these files, thanks for finding it! I'll give it a thorough look later :)

EDIT:

I think I found the format for the files with "type" 06. Images are divided in 8x8 tiles:



(ignore the faulty palette)

It goes like:

bytes 0 - 2: "BMP".
byte 3: type? palette number? 06, 07, 09 or 0a.
bytes 4 - 7: number of colours in palette.
bytes 8 - 11: width (divide by 8 to get number of tiles in a row)
bytes 12 - 15: height (divide by 8 to get number of tiles in a column)
bytes 16 - 31: all zeroes.

I'm beginning to wonder how to edit tiled images...