pixfx

Command line

The pixfx binary renders effects to sprite sheets and GIFs, and checks ports against pixelfx.

Run it

From the repository, through cargo:

cargo run -p pixfx-cli -- <command> ...

Or install the binary once and call pixfx directly:

cargo install --path crates/pixfx-cli
pixfx sheet fire/candle

Usage:

pixfx parity <id> [--pixelfx DIR] [--out DIR]
pixfx sheet <id> [--out DIR]
pixfx render <id> --gif [--scale N] [--out DIR]

Output files are named after the id with / replaced by _: fire/candle becomes fire_candle. Each command prints the id and the path it wrote.

sheet

Render one loop (or the whole one-shot) at the effect's fps and write a sprite sheet.

pixfx sheet fire/candle --out out
FileContents
fire_candle.pngRGBA. Colour with light added, over transparency. Use it where you cannot blend additively.
fire_candle_color.pngRGBA. The colour layer alone.
fire_candle_light.pngRGB. The light layer alone, to draw additively over the colour sheet.
fire_candle.jsonAseprite-style "array" JSON with beanfx's fields. See Sprite sheet format.
FlagDefaultMeaning
--out DIRtarget/outDirectory to write into; created if missing.

render --gif

Write a looping GIF, composited over a dark backdrop (rgb(20, 18, 28)), since GIF has no partial transparency.

pixfx render fire/campfire --gif --scale 4 --out out
FlagDefaultMeaning
--gifRequired; GIF is the only render format.
--scale N4Each pixel becomes N×N. At least 1. The scaled size must fit GIF's 65535-pixel limit.
--out DIRtarget/outDirectory to write into.

Frame delay is 1/fps rounded to GIF's hundredths of a second.

parity

Render an effect with pixelfx and with its pixfx port and compare every pixel of every frame. See Parity and tests for setup.

pixfx parity fire/candle --pixelfx /tmp/pixelfx --out target/parity
FlagDefaultMeaning
--pixelfx DIR$PIXELFX, else ./pixelfxA pixelfx checkout. Needs Node on the path.
--out DIRtarget/parityWhere the reference render and the side-by-side GIF go.

It prints <id>: colour x% differ, light y% differ → PASS (or FAIL) and writes <out>/<id>.side.gif, pixelfx on the left and pixfx on the right.

Exit codes

CodeMeaning
0Success; for parity, PASS.
1parity ran and FAILed the gate.
2Could not run: bad arguments, an unknown effect id, a write error, or a pixelfx render that failed. The message starts with pixfx: on stderr.

Options

The CLI renders with default options (the effect's default seed, palette and own options) and margin 0, so its output matches pixelfx's own sheets. To export with other options or a glow margin, call render_frames and the export functions from Rust.