FORMAT DETAILS
.RBGI means Render Background Image. It was made so tools like
Source BSP Explorer could use a custom render-background / skybox-background file type instead of
using normal image extensions directly.
A real RBGI v1 file is not just a renamed PNG. It is a small custom container that
stores a binary RBGI header, compact JSON metadata, and embedded PNG image bytes.
REAL RBGI V1:
[ RBGI HEADER ][ JSON METADATA ][ PNG IMAGE DATA ]
HEADER LAYOUT
OFFSET TYPE NAME
0 char[4] magic = "RBGI"
4 quint16 version = 1
6 quint32 headerSize = 38
10 quint32 width
14 quint32 height
18 quint32 image mode
22 quint32 flags
26 quint64 pngSize
34 quint32 metadataSize
38 byte[] compact JSON metadata
38+M byte[] embedded PNG bytes
IMAGE MODES
The SDK has multiple image mode values so .RBGI files can describe how they are meant to be used.
0 = FlatImage
1 = RenderBackground
2 = SkyBoxSingleTexture
3 = SkyBoxCubeTexture
HOW THE LOADER WORKS
1. Read the file bytes.
2. Check if the file starts with "RBGI".
3. If yes, load it as a real RBGI v1 file.
4. If no, try to load it as PNG image data.
5. If PNG loading works, mark it as a legacy renamed-PNG RBGI.
6. If both paths fail, the file is invalid.
SDK OUTPUT
When loading a file, the SDK returns a document-style result with the decoded image, width, height,
metadata, image mode, version, flags, embedded PNG bytes, legacy-file status, validity state, and
an error message if something failed.
SAFETY LIMITS
The SDK includes safety checks for invalid files. It rejects empty files, unsupported versions,
invalid metadata JSON, invalid PNG data, and files that are neither real RBGI v1 files nor valid
legacy PNG data.
MAX METADATA SIZE: 8 MiB
MAX PNG SIZE: 512 MiB
WHEN TO USE REAL RBGI V1
New tools should save real RBGI v1 files using the SDK's real save function. Legacy renamed-PNG
saving should only be used when older compatibility is needed.