The PPM thumbnail is a 64 × 48 indexed image stored as 8 × 8 tiles, with two four-bit pixels per byte. It is not a copy of a full 256 × 192 animation frame. A viewer should decode the thumbnail according to its tiled layout and hard-coded palette. [1][2]
Images outside a PPM
The Flipnote Studio Docs wiki describes .nbf top-screen backgrounds, .npf and .ntft resources used by online pages and menus. These formats differ in dimensions, colour storage and intended use; they should be parsed by type rather than passed through a generic PPM frame decoder. The original-ROM research also maps embedded UI archives, layout records, fonts and sprite resources. [3][4][5][6]
| Type | Encoding | Typical use |
|---|---|---|
.nbf | Indexed pixels with an RGB555 palette | Top-screen background |
.npf | Four-bit palette indices, with index 0 transparent | Small previews and icons |
.ntft | Direct RGBA5551 pixels, no palette | Web-client imagery and UGO icons |
For a page renderer, keep image decoding separate from link and layout interpretation. An image asset can show what a screen could display, but its presence alone does not prove that a specific feature or hardware path was used. [6]
Choose a decoder by context
A PPM thumbnail is 64 × 48 tiled 4-bpp data inside the animation file. The online client can instead fetch standalone NBF, NPF or NTFT images. Their common use in a menu does not make their byte layouts equivalent. Read the container magic and the requesting UI path before selecting a decoder. [1][3][4][5]
Palette and transparency
NBF uses an indexed image and RGB555 palette; NPF uses four-bit palette indices with index zero transparent. NTFT stores pixel colour words directly in RGBA5551 and has no palette header. Palette length, image dimensions and row stride must be validated independently, because some formats do not encode display dimensions inside the file. [3][4][5]
Pixel order
Standalone image data is generally read left to right across each scanline. The PPM thumbnail uses tiles instead. Treating the latter as a linear bitmap produces a recognisable but scrambled picture; using HTML element width to infer the stored row stride can likewise misread padded NPF and NTFT images. [1][3][4][5]
PPM thumbnail palette
The PPM's 64 × 48 preview contains 1,536 bytes from absolute offset 0x00A0. The image consists of 8 × 8 tiles. Walk tiles in row-major order, then each tile's rows; a byte holds two 4-bit palette indices, with the low nibble supplying the earlier pixel. This is a separate representation from decoded 256 × 192 animation frames. [7]
| Index | RGB value | Index | RGB value |
|---|---|---|---|
| 0 | #FFFFFF | 8 | #4840FF |
| 1 | #525252 | 9 | #514FB8 |
| 2 | #FFFFFF | 10 | #ADABFF |
| 3 | #9C9C9C | 11 | #00FF00 |
| 4 | #FF4844 | 12 | #B657B7 |
| 5 | #C8514F | 13 | #00FF00 |
| 6 | #FFADAC | 14 | #00FF00 |
| 7 | #00FF00 | 15 | #00FF00 |
Some palette indices have the same white or bright green RGB value in the documented hardcoded palette. Keep the original indices when saving a thumbnail: replacing one with another that looks identical still changes the stored bytes. [7]
Thumbnail tile sizing
A 64 × 48 preview contains eight tile columns and six tile rows. Each 8 × 8 tile holds 64 four-bit indices, or 32 bytes. The complete preview therefore uses 8 × 6 × 32 = 1,536 bytes. Tile number t starts at 0xA0 + 32 × t, with tiles numbered across each tile row before moving down. The thumbnail uses this fixed tile layout, rather than forty-eight ordinary 32-byte scanlines. [8]
DSiBrew's five-bit colour approximations
DSiBrew gives approximate preview colours as DS-channel values from 0 to 31. The table below records that historical approximation alongside the 24-bit RGB palette above. There is no second palette stored in the PPM. Expanding these triples directly does not reproduce every RGB value used by later decoders. [8]
| Index | Description in the early reference | Approximate R, G, B (five bits each) |
|---|---|---|
| 0x0 | Unused / white | 31, 31, 31 |
| 0x1 | Dark grey | 10, 10, 10 |
| 0x2 | White | 31, 31, 31 |
| 0x3 | Light grey | 20, 20, 20 |
| 0x4 | Red | 31, 0, 0 |
| 0x5 | Dark red | 15, 0, 0 |
| 0x6 | Light red / pink | 31, 15, 15 |
| 0x7 | Green | 0, 31, 0 |
| 0x8 | Blue | 0, 0, 31 |
| 0x9 | Dark blue | 0, 0, 15 |
| 0xA | Light blue | 15, 15, 31 |
| 0xB | Green | 0, 31, 0 |
| 0xC | Magenta / purple | 31, 0, 31 |
| 0xD | Green | 0, 31, 0 |
| 0xE | Green | 0, 31, 0 |
| 0xF | Green | 0, 31, 0 |
Historical preview-extraction tools
DSiBrew links pbsds's PPMtool, originally a command-line utility for reading PPM information and extracting the preview as BMP. Its author later replaced that version with a Python tool that could also extract animation frames; the January 2017 update points readers to Hatenatools. These are historical tools; their old downloadable binaries have not been checked on current operating systems. [9]
