pxart help recipes
Recipes
Seven workflows, end to end, command by command.
RECIPES (pxart help recipes)
Seven workflows, end to end. Each runs as written from a folder holding the files it names;
'pxart help CMD' has the rest of each command.
1. Port a pack and prove it lossless
A pack's loose PNGs and the labels.csv it ships become one .px, or several in a folder.
One diff then checks every frame against its PNG and exits 1 if any differs: a .px's
frames, or every frame of every .px in the folder (--exclude GLOB leaves some out).
$ pxart from-png pack/*.png --labels pack/labels.csv -o town.px
$ pxart diff town.px pack/ --labels pack/labels.csv
$ pxart from-png pack/tile_0000.png pack/tile_0002.png --labels pack/labels.csv -o town/ground.px
$ pxart from-png pack/tile_0001.png pack/tile_0003.png --labels pack/labels.csv -o town/props.px
$ pxart diff town/ pack/ --labels pack/labels.csv
$ pxart check town/
2. Merge packs, variants and all
Two characters from different packs into one file that imports a shared palette: --prefix
keeps their ids apart, --rekey their keys, and --variant-map reads the keeper's dark as
party.px's night. diff proves each copy renders as its original, variant by variant.
$ pxart new party.px --empty --palette pal.px
$ pxart frames wick.px:walk --copy-to party.px --prefix wick/
$ pxart frames keeper.px:walk --copy-to party.px --prefix keeper/ --rekey --variant-map night=dark
$ pxart diff keeper.px:walk party.px:keeper/walk
$ pxart diff keeper.px:walk%dark party.px:keeper/walk%night
$ pxart diff wick.px:walk%night party.px:wick/walk%night
3. Build a dusk or a night
A night derived from the base colors (darkened, tinted, the lamp kept lit), or a dusk
fitted to another pack's; then read what each recolors, and one pixel in every variant.
$ pxart palette pal.px --variant night --derive-from base --darken 0.35 --tint '#10183060' --keep-lit y
$ pxart palette pal.px --variant dusk --derive-from base --match mossback.px%dusk
$ pxart palette pal.px
$ pxart stats hero.px:idle/0 --at 7,2
$ pxart sheet hero.px --variant night -o night.png
4. Slice a sheet
A 64x64 sheet whose columns are directions: a group per column, then timing, and a look.
$ pxart from-png Walk.png --grid 16x16 --by cols --names walk/down,walk/up,walk/left,walk/right -o boy.px
$ pxart anim-set boy.px:walk/down ms=120 direction=pingpong
$ pxart frames boy.px
$ pxart sheet boy.px --rows group -o boy.png
5. Make a scene from a map
A text tilemap (scene in 'pxart help LOOKING' has the format) renders as a PNG, or
composes into a .px room that renders the same, pixel for pixel, base and night (the
proofs render at 1x on a transparent --bg). --rekey gives the map's lamp.px%base its own
keys, so the room's night leaves it lit, as scene does.
$ pxart check market.map
$ pxart compose --map market.map -o market.px --rekey
$ pxart scene --map market.map --bg transparent --scale 1 -o market.png
$ pxart diff market.px market.png
$ pxart scene --map market.map --bg transparent --scale 1 --variant night -o night.png
$ pxart diff market.px%night night.png
6. Check an animation's feet
anim prints what moved in each frame: 'rows 9+ still' says rows 9 down (the feet) never
moved, where 'shift +0,+1 then 0px' would be the whole sprite bobbing, feet and all. onion
--feet 3 reads the bottom 3 rows alone ('bottom +0': the feet stayed put). A pivot on the
feet then lines the frames up in sheet and anim. A whole-sprite bob ('shift +0,+1 then
0px', feet and all) isn't a feet problem, and no pivot fixes it: shift that frame back up
(shift FILE:frame --dy -1), then lower only the body (--region x,y,w,h above the feet).
$ pxart anim hero.px:walk/down
$ pxart onion hero.px:walk/down/0 hero.px:walk/down/1 --feet 3 -o feet.png
$ pxart anim-set hero.px:walk/down pivot=8,11
$ pxart sheet hero.px:walk/down --align pivot --fit -o walk.png
$ pxart anim hero.px:walk/down -o walk.gif
7. Stamp an overlay behind every frame of an animation
A glow drawn once, as a frame of its own, goes behind every frame of a flight: --align
shift moves it as anim's best shifts say the body bobs (--at places it in the first
frame; bbox would follow the wing tips), and --under keeps it behind. Its key is
transparent by day and lit at night, so the sheet shows the flight and the glow (FILE:a,b
lists them) at night.
$ pxart palette pal.px --add G=transparent
$ pxart palette pal.px --variant night --add 'G=#f3cf6b60'
$ pxart new bat.px:glow --size 16x12
$ pxart ellipse bat.px:glow G --box 2,0,12,9 --ring 2
$ pxart paste bat.px:glow --into bat.px:fly --at 0,1 --under --align shift
$ pxart sheet bat.px:fly,glow --variant night -o glow.pngThis page is built from
site/src/data/reference.json in the repository.Edit on GitHub