AnimaEngine is a C99 sprite extraction and preview toolchain for Nintendo DS
Pokemon Black, White, Black 2, and White 2 battle graphics. It works with the
original Gen V games and their sequels by reading the Pokegra archive
(/a/0/0/4), decoding Nitro graphics formats, reconstructing multi-part battle
sprites, and exporting PNG previews, animated idle GIFs, idle break GIFs,
composed idle-to-break GIFs, and reconstruction JSON.
No ROMs, save files, extracted Pokemon assets, or Nintendo copyrighted data are
included in this repository or in release packages. You must provide your own
legally dumped .nds ROM. Pokémon and individual species names are trademarks
of Nintendo, Game Freak, and Creatures Inc.; see
THIRD_PARTY_NOTICES.md for the full trademark
disclaimer.
-
GUI browser with live previews, Pokemon search, side/gender/shiny/form controls, animation speed control, and per-asset export.
-
CLI extraction for automated workflows.
-
Nitro parsers for NCGR, NCLR, NCER, NANR, NMCR, and NMAR.
-
Separate idle, idle break, composed, spritesheet, static PNG, NDS file, raw member, and reconstruction JSON outputs.
-
Canonical full-export folder layout:
out/pokedexNNN_PokemonName/ raw_narc_members/ nds_files/ reconstruction_json/ spritesheet_png/ static_png/ animated_idle_gif/ idle_break_gif/ composed_gif/
The pipeline is built from small, single-responsibility C modules so each stage is easy to test and reason about end to end:
- ROM mount —
nds_header,nds_fat, andnds_fntparse the Nintendo DS cartridge header, the File Allocation Table, and the File Name Table to give a path-addressable filesystem over the.ndsblob. - Archive extraction —
narcreads the Pokegra archive at/a/0/0/4into individual members (NCGR, NCLR, NCER, NANR, NMCR, NMAR). - Format decoding — Each Nitro format has its own parser:
ncgrdecodes tile graphics,nclrdecodes palettes,ncerdecodes sprite cells,nanrdecodes frame animations, andnmcr/nmardecode multi-cell / multi-animation banks. - Decompression —
lztransparently handles LZ10 and LZ11 streams that wrap NARC members in many DS titles. - Composition —
sprite_composerlays the multi-part battle sprite down on a canvas, applying per-cell offsets, palette indices, and animation state. - Export —
png_writerandgif_writerwrite the result.gif_pipelineandpng_pipelinewrap the writers to produce spritesheets, animated idle GIFs, idle-break GIFs, composed GIFs, and static PNGs.json_exportemits reconstruction metadata so a downstream tool can reproduce the export. - GUI — The raylib-based GUI (
gui_*) provides live preview, search, side/gender/shiny/form controls, and per-asset export on top of the same backend (anima_backend) used by the CLI.
The CLI and GUI share the same source/anima_backend.c entry point, so
behaviour is identical between them.
Tagged GitHub Releases provide precompiled GUI packages for Linux, Windows, and macOS (Apple Silicon and Intel). These packages bundle the raylib runtime where needed, so users do not need to install raylib just to run the GUI.
- Linux: extract
AnimaEngine-*-linux-x86_64.tar.gzand run./run-gui.sh. - Windows: extract
AnimaEngine-*-windows-x86_64.zipand runAnimaEngineGUI.exe. - macOS (Apple Silicon): extract
AnimaEngine-*-macos-arm64.tar.gzand run./run-gui.command. - macOS (Intel): extract
AnimaEngine-*-macos-x86_64.tar.gzand run./run-gui.command. The binaries are not codesigned yet, so macOS may require right-clicking and choosing Open.
- C99 compiler: GCC or Clang
makepkg-configlibpngraylibfor GUI builds onlydoxygenfor generated API docs
On Debian/Ubuntu for local development:
sudo apt install build-essential make pkg-config libpng-dev doxygenInstall raylib through your package manager or from source before building the GUI locally.
make # builds ./AnimaEngine
make gui # builds ./AnimaEngineGUI
make test # builds and runs the unit tests
make docs # generates Doxygen output under docs/build
make clean # removes local binaries and object files./AnimaEngineGUILoad a Pokemon Black, White, Black 2, or White 2 .nds ROM, choose a species,
select the preview asset, and export the current preview, the species DS files,
or all assets.
Full export mode writes to a canonical species folder below the output root:
./AnimaEngine PokemonWhite.nds 7 out --gif-side both --gif-palette normal --gif-break --gif-composed
# Sequels are supported too:
./AnimaEngine PokemonBlack2.nds 7 out --gif-side both --gif-palette normal --gif-break --gif-composedThat command writes Squirtle assets under:
out/pokedex007_Squirtle/
Single asset export mode writes exactly to the requested output path:
./AnimaEngine PokemonWhite.nds 25 out/pikachu_idle.gif --mode single --asset idle
./AnimaEngine PokemonWhite.nds 25 out/pikachu_sheet.png --mode single --asset spritesheetNote: in --mode single the third positional argument is the destination
file path; in default (full) mode it is a directory. Use --mode explicitly
when in doubt.
Run the built-in help for all options:
./AnimaEngine --helpThe latest published API reference lives at
https://killdawill.github.io/AnimaEngine/ (built automatically from
main by the docs workflow).
To generate the docs locally:
make docsOpen docs/build/html/index.html after generation.
AnimaEngine code is released under the MIT License. See LICENSE. Third-party runtime and trademark notices are listed in THIRD_PARTY_NOTICES.md.
Issues and pull requests are welcome. For anything that touches sprite reconstruction or format decoding, please attach a small reproducer (a hex dump of the NARC member and the expected output is enough) so the change can be verified. See CHANGELOG.md for the release history.

