5bg File Format

Tylerblu2103

New Member
Newbie
Joined
May 12, 2025
Messages
2
Reaction score
0
Trophies
0
Age
25
XP
52
Country
United States
I'm trying to extract files from Kuruma de DS, but the game files contain ".5bg" files. I looked and I saw stuff about ".lz5bg" files, but not the other format. If anyone knows what to do, please let me know ^_^

Heres the file I'm talking about

Screenshot 2026-01-12 165555.png
 
Don't know much about it, however it looks like few in one custom nitro-files graphics container, somewhere at offset 26 is stored palette, and at 576 are graphics data.
First open file as palette and then again as backgroud in Tinke.
1768303304347.png
 
  • Like
Reactions: Tylerblu2103
The 5bg format (which a file having an extension .lz5bg, is likely to just be an LZ-compressed version of) the BG/OBJ graphics file format of iMageStudio 5.

These take the structure of a binary block sequence (the same one as in an NCLR, NCGR, etc format file). These files have a file signature of NTBG. They contain these blocks:

BlockUsage
PALTColor palette. Required for all indexed graphics formats.
BGDTBG data. Contains character/bitmap data and BG screen data, if appplicable. This block's presence means this is a BG data file.
OBJDOBJ data. This block's presence means this is an OBJ data file.
DFPLCharacter attribute data.
COMTComment data (optional).
XTRAExtra data (optional).

PALT Block
This block stores the color palette. Its structure is:
OffsetTypeMeaning
00u32Number of palette colors.
04u16[]Palette colors.

BGDT Block
This block stores the BG data. Its structure is:
OffsetTypeMeaning
00u8BG type
01u8BG size
02u8BG screen unit size
03u8Padding (not used)
04u32BG screen size
08u16BG height tiles
0Au16BG width tiles
0Cu16Character width tiles
0Eu16Character height tiles
10u32Character data size

The BG type field takes on a value from these:

ValueMeaning
00Text BG (16x16)
01Text BG (256x1)
02
03Affine BG (256x1)
04
10Bitmap BG (256x1)
11Large Bitmap BG (256x1)
12Direct Color BG

The value of the BG type is used to give meaning to the BG size field, which may take on a value between 0 and 3, or FF. Values 0-3 correspond to the size parameter of the size parameter for a background layer of a given type, and FF indicates the "free size" (i.e. size is not constrained to hardware-supported background size). For the large bitmap BG format, this may not be 2 or 3.

The BG screen unit size field controls how the BG screen data is interpreted. It may be 0, 1, 2, 4, 6, 8, or 10 (decimal). For the bitmap BG formats, this field must be 0, and for other formats it must be nonzero. The format of screen data depends on this size parameter, and these are following:

SizeFormat
0No BG screen data exists.
1Screen data is an 8-bit character name.
2Screen data format is the same as text/affine extended screen data format.
4Screen data format is extended to 32 bits, with low 16 bits holding the character name, and upper 6 bits holding the palette index and flipping mode.
6...
8
10

Following the header is the BG screen data (if it exists), then the character/bitmap data. The size of character data may be less than the size indicated by the character dimensions in the header.

OBJD Block
This block stores the OBJ mode graphics data. It takes the structure:
OffsetTypeMeaning
00u32OBJ attribute info
04u32OBJ data size
08u16OBJ screen width
0Au16OBJ screen height
0Cu32
10u16Character width tiles
12u16Character height tiles
14u32Character graphics size

Following the header is the OBJ data array. Following the OBJ data array is the character data.

DFPL Block
This block stores attribute data for the character graphics and is optional.

COMT Block
This block st ores comment information in the file and is optional. It takes the form of a 16-bit comment length, followed by the comment string.

XTRA Block
This block is optional.
 
Last edited by DailyWeather,
  • Like
Reactions: Tylerblu2103
The 5bg format (which a file having an extension .lz5bg, is likely to just be an LZ-compressed version of) the BG/OBJ graphics file format of iMageStudio 5.

These take the structure of a binary block sequence (the same one as in an NCLR, NCGR, etc format file). These files have a file signature of NTBG. They contain these blocks:

[TABLE=full]
[TR]
[td]Block[/td][td]Usage[/td]
[/TR]
[TR]
[td]PALT[/td][td]Color palette. Required for all indexed graphics formats.[/td]
[/TR]
[TR]
[td]BGDT[/td][td]BG data. Contains character/bitmap data and BG screen data, if appplicable. This block's presence means this is a BG data file.[/td]
[/TR]
[TR]
[td]OBJD[/td][td]OBJ data. This block's presence means this is an OBJ data file.[/td]
[/TR]
[TR]
[td]DFPL[/td][td]Character attribute data.[/td]
[/TR]
[TR]
[td]COMT[/td][td]Comment data (optional).[/td]
[/TR]
[TR]
[td]XTRA[/td][td]Extra data (optional).[/td]
[/TR]
[/TABLE]

PALT Block
This block stores the color palette. Its structure is:
[TABLE=full]
[TR]
[td]Offset[/td][td]Type[/td][td]Meaning[/td]
[/TR]
[TR]
[td]00[/td][td]u32[/td][td]Number of palette colors.[/td]
[/TR]
[TR]
[td]04[/td][td]u16[][/td][td]Palette colors.[/td]
[/TR]
[/TABLE]

BGDT Block
This block stores the BG data. Its structure is:
[TABLE=full]
[TR]
[td]Offset[/td][td]Type[/td][td]Meaning[/td]
[/TR]
[TR]
[td]00[/td][td]u8[/td][td]BG type[/td]
[/TR]
[TR]
[td]01[/td][td]u8[/td][td]BG size[/td]
[/TR]
[TR]
[td]02[/td][td]u8[/td][td]BG screen unit size[/td]
[/TR]
[TR]
[td]03[/td][td]u8[/td][td]Padding (not used)[/td]
[/TR]
[TR]
[td]04[/td][td]u32[/td][td]BG screen size[/td]
[/TR]
[TR]
[td]08[/td][td]u16[/td][td]BG height tiles[/td]
[/TR]
[TR]
[td]0A[/td][td]u16[/td][td]BG width tiles[/td]
[/TR]
[TR]
[td]0C[/td][td]u16[/td][td]Character width tiles[/td]
[/TR]
[TR]
[td]0E[/td][td]u16[/td][td]Character height tiles[/td]
[/TR]
[TR]
[td]10[/td][td]u32[/td][td]Character data size[/td]
[/TR]
[/TABLE]

The BG type field takes on a value from these:

[TABLE=full]
[TR]
[td]Value[/td][td]Meaning[/td]
[/TR]
[TR]
[td]00[/td][td]Text BG (16x16)[/td]
[/TR]
[TR]
[td]01[/td][td]Text BG (256x1)[/td]
[/TR]
[TR]
[td]02[/td][td][/td]
[/TR]
[TR]
[td]03[/td][td]Affine BG (256x1)[/td]
[/TR]
[TR]
[td]04[/td][td][/td]
[/TR]
[TR]
[td]10[/td][td]Bitmap BG (256x1)[/td]
[/TR]
[TR]
[td]11[/td][td]Large Bitmap BG (256x1)[/td]
[/TR]
[TR]
[td]12[/td][td]Direct Color BG[/td]
[/TR]
[/TABLE]

The value of the BG type is used to give meaning to the BG size field, which may take on a value between 0 and 3, or FF. Values 0-3 correspond to the size parameter of the size parameter for a background layer of a given type, and FF indicates the "free size" (i.e. size is not constrained to hardware-supported background size). For the large bitmap BG format, this may not be 2 or 3.

The BG screen unit size field controls how the BG screen data is interpreted. It may be 0, 1, 2, 4, 6, 8, or 10 (decimal). For the bitmap BG formats, this field must be 0, and for other formats it must be nonzero. The format of screen data depends on this size parameter, and these are following:

[TABLE=full]
[TR]
[td]Size[/td][td]Format[/td]
[/TR]
[TR]
[td]0[/td][td]No BG screen data exists.[/td]
[/TR]
[TR]
[td]1[/td][td]Screen data is an 8-bit character name.[/td]
[/TR]
[TR]
[td]2[/td][td]Screen data format is the same as text/affine extended screen data format.[/td]
[/TR]
[TR]
[td]4[/td][td]Screen data format is extended to 32 bits, with low 16 bits holding the character name, and upper 6 bits holding the palette index and flipping mode.[/td]
[/TR]
[TR]
[td]6[/td][td]...[/td]
[/TR]
[TR]
[td]8[/td][td][/td]
[/TR]
[TR]
[td]10[/td][td][/td]
[/TR]
[/TABLE]

Following the header is the BG screen data (if it exists), then the character/bitmap data. The size of character data may be less than the size indicated by the character dimensions in the header.

OBJD Block
This block stores the OBJ mode graphics data. It takes the structure:
[TABLE=full]
[TR]
[td]Offset[/td][td]Type[/td][td]Meaning[/td]
[/TR]
[TR]
[td]00[/td][td]u32[/td][td]OBJ attribute info[/td]
[/TR]
[TR]
[td]04[/td][td]u32[/td][td]OBJ data size[/td]
[/TR]
[TR]
[td]08[/td][td]u16[/td][td]OBJ screen width[/td]
[/TR]
[TR]
[td]0A[/td][td]u16[/td][td]OBJ screen height[/td]
[/TR]
[TR]
[td]0C[/td][td]u32[/td][td][/td]
[/TR]
[TR]
[td]10[/td][td]u16[/td][td]Character width tiles[/td]
[/TR]
[TR]
[td]12[/td][td]u16[/td][td]Character height tiles[/td]
[/TR]
[TR]
[td]14[/td][td]u32[/td][td]Character graphics size[/td]
[/TR]
[/TABLE]

Following the header is the OBJ data array. Following the OBJ data array is the character data.

DFPL Block
This block stores attribute data for the character graphics and is optional.

COMT Block
This block st ores comment information in the file and is optional. It takes the form of a 16-bit comment length, followed by the comment string.

XTRA Block
This block is optional.
Thanks for that info! But do you know how i can view the contents inside it or not (if its possible ofc) Sorry if i sound stupid or not, I'm mostly new to this stuff.

Here are some of the files (I probably should've posted them sooner)
https://drive.google.com/drive/folders/1EWOPrWILOhiQp1VW_Chh4DjA98hXLbDk?usp=sharing

also if the link doesnt work let me know
 

Site & Scene News

Popular threads in this forum