Skip to content

.nbf image format

james edited this page Sep 29, 2018 · 9 revisions

Overview

This image format is used for top screen backgrounds. Like the other image formats used by the app, no image dimensions are provided so they're always assumed to be 256 x 192 pixels. This format can be used from both HTML pages and ugomenus.

This image format uses indexed color.

Format documentation

Header

Type Details
char[4] File magic UGAR
uint32 Section count (always 2)
uint32 Palette data length
uint32 Image data length

Palette Data

Colors are stored in rgb555 format, so that each color only uses two bytes of data.

The length of this section should always be padded to the nearest power of 2.

Image Data

Each pixel of the image is an 8-bit index into the color palette, starting at 0.

Images are read using a scanline method. The data starts with the pixel at the top-left, then progresses linearly left-to-right, top-to-bottom until the pixel in the bottom-right corner.

The length of this section should always be padded to the nearest power of 2.