#image #nintendo-64 #texture

bin+lib pigment64

A library for handling conversion between N64 texture formats and modern image formats

10 releases

Uses new Rust 2024

0.6.3 Dec 29, 2025
0.6.2 Dec 25, 2025
0.4.5 Apr 4, 2024
0.4.3 Jan 14, 2024
0.2.2 Jul 15, 2023

#390 in Game dev

33 downloads per month
Used in 4 crates (2 directly)

MIT license

385KB
1K SLoC

pigment64

Rust Crates.io License

pigment64 is a library written in Rust for converting N64 image data between native and png formats.

Supported formats

pigment64 supports a variety of common N64 image formats:

  • Intensity: I1, I4, I8
  • Intensity + Alpha: IA4, IA8, IA16
  • Color Indexed: CI4, CI8
  • Direct Color: RGBA16, RGBA32

Command line usage

pigment64 provides command-line interface (CLI):

Usage: pigment64_cli <COMMAND>

Commands:
  to-png  Converts a binary image to a PNG
  to-bin  Converts a PNG to a binary image
  help    Print this message or the help of the given subcommand(s)

Library usage

To use pigment64 in your Rust project simply run a

cargo add pigment64

Python bindings

pigment64 can also be used as a Python module, allowing you to integrate it into your Python scripts and tools.

You can install the Python module from PyPI:

pip install pigment64

Python Binding Development

This project uses maturin to build the Rust-based Python extension. It is recommended to use a Python virtual environment.

Setup

  1. Create and activate a virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
    
  2. Install dependencies:

    pip install maturin pytest
    

Building

To compile the library and install it into your active virtual environment, run:

maturin develop

License

This project is licensed under the MIT License.

Dependencies

~2.4–4MB
~72K SLoC