This repository includes a Python implementation of the PixiParser and several utility scripts for checking, generating and inspecting .pixi files.
You will need Python 3.9+ (due to skia-python compatibility).
Install dependencies:
pip install skia-python pillow msgpackThe core parser logic is in pixi_parser.py. It supports full serialization and deserialization of .pixi files (v5+), including preserving binary types (float32/int32) required for exact binary compatibility.
from pixi_parser import PixiParser
# Deserialize
doc = PixiParser.deserialize("my_file.pixi")
# Modify
doc.width = 100
# Serialize
PixiParser.serialize(doc, "modified.pixi")generate_spritesheet.py is a powerful tool to convert a standard grid-based spritesheet (PNG) into a fully animated .pixi file with keyframes.
Usage:
- Place your spritesheet PNG in the
test/folder (or modify the script). - Run the script:
python generate_spritesheet.py
- It will automatically:
- Detect grid size and frame count.
- Encode frames using QOI compression (efficient storage).
- Generate a valid
.pixistructure with AnimationData, Layers, KeyFrames, and Timeline Grouping.
inspect_pixi.py provides a detailed, human-readable dump of any .pixi file structure.
Usage:
python inspect_pixi.py path/to/file.pixiIt displays header info, animation settings, node hierarchy, properties, and keyframe details.
pixi.hexpat is a ImHex pattern file. Load this in ImHex to inspect the binary structure of .pixi files. It includes full MessagePack parsing definitions (msgpack.hexpat) to visualize the internal object structure.
test_parser.py: Unit tests for the parser.generate_f1.py: Test script for single-frame generation and binary structure verification.