@vukovicpavle/pixon
v0.1.0
Published
CLI for turning JSON pixel art into engine-ready assets
Readme
Pixon
pixon is a Node.js CLI that turns schema-defined JSON into pixel art assets for game projects.
It takes a JSON document with name, description, metadata, and a 2D pixels matrix, then exports:
- A PNG sprite/image that imports cleanly into Godot, Unity, and Unreal Engine
- A manifest with dimensions, palette, and metadata
- Engine preset JSON files with recommended import settings for each engine
Install
npm installRun locally with:
node src/cli.js render examples/hero.json --out dist --target allTry the larger background scene example with:
node src/cli.js render examples/background-meadow.json --out dist --target allThat example renders to an exact 1280x720 PNG.
Or install the CLI globally from this folder:
npm link
pixon render examples/hero.json --out distCommands
Validate input:
pixon validate examples/hero.jsonRender a PNG plus presets:
pixon render examples/hero.json --out dist --target allRender the larger background example:
pixon render examples/background-meadow.json --out dist --target allPrint the schema:
pixon schemaWrite the schema to a file:
pixon schema --out pixel-art.schema.jsonJSON shape
The schema lives at schema/pixel-art.schema.json.
Top-level fields:
name: asset namedescription: human-readable descriptionmetadata: free-form metadata object with useful common fields likescale,pixelsPerUnit,tileWidth, andtileHeightpixels: rectangular 2D matrix of color values
Supported pixel color formats:
- Hex strings:
#RGB,#RGBA,#RRGGBB,#RRGGBBAA "transparent"- RGBA objects like
{ "r": 255, "g": 0, "b": 0, "a": 255 }
Example:
{
"name": "Hero Idle",
"description": "An 8x8 hero portrait exported as pixel art.",
"metadata": {
"scale": 8,
"pixelsPerUnit": 16
},
"pixels": [
["#000000", "#ffffff"],
["transparent", { "r": 255, "g": 0, "b": 0, "a": 255 }]
]
}Additional example files:
examples/hero.json: small 8x8 character portraitexamples/background-meadow.json:160x90meadow scene exported at scale8for an exact1280x720output
Output files
For an asset named Hero Idle, rendering to dist/ generates:
dist/hero-idle.pngdist/hero-idle.manifest.jsondist/hero-idle.godot.import.jsondist/hero-idle.unity.import.jsondist/hero-idle.unreal.import.json
The PNG is the actual engine-importable asset. The preset files document import settings that preserve crisp pixel art in each engine.
