Reference · Converting

pxart export

Write frames as PNGs (--frames), an Aseprite sheet and JSON (--aseprite) or a Tiled tileset (--tiled), from files or whole folders; or compile a world (world.src.json and its .map rooms) to Tiled maps and a .world (--tiled).

export FILE|DIR[:SEL]... [--frames DIR] [--aseprite sheet.json] [--tiled tiles.tsj] [--variant V] [--prefix-file] [--exclude GLOB] [--indexed X.json]
usage: pxart export [-h] [--frames FRAMES] [--aseprite ASEPRITE] [--tile TILE] [--tiled [X.tsj]]
                    [--variant VARIANT] [--indexed X.json] [--tileset T.tsj] [--prefix-file]
                    [--exclude GLOB]
                    [files ...]

  export FILE|DIR[:SEL]... [--frames DIR] [--aseprite sheet.json] [--tiled tiles.tsj] [--variant V]
         [--prefix-file] [--exclude GLOB] [--indexed X.json]
      Write frames as PNGs (--frames), an Aseprite sheet and JSON (--aseprite) or a Tiled tileset
      (--tiled), from files or whole folders; or compile a world (world.src.json and its .map rooms)
      to Tiled maps and a .world (--tiled).

positional arguments:
  files

options:
  -h, --help           show this help message and exit
  --frames FRAMES
  --aseprite ASEPRITE
  --tile TILE          sources: the rooms' tile size, WxH or N for NxN (default 16x16)
  --tiled [X.tsj]      frames: a Tiled tileset X.tsj; world.src.json or .map sources: their .tmj/.world beside them
  --variant VARIANT
  --indexed X.json     frames as rows of palette keys, with the palette, its slots and variants, for a game that recolors at runtime (help slots)
  --tileset T.tsj      sources: rooms may draw with this tileset too, beside their packs' tiled/*.tsj (repeatable)
  --prefix-file        id each file's frames FILE/ID (FILE: its path under DIR, or its stem), so ids can't collide
  --exclude GLOB       leave out files whose name or path under DIR matches GLOB, or under a matching directory (repeatable)

      --frames: one PNG per frame at DIR/<frame id>.png, and DIR/pivots.json when frames have
        pivots: {"walk/0": {"x": 8, "y": 23}, ...} (frames without one are left out)
      --aseprite: sheet PNG + Aseprite-style JSON (frames, durations, frameTags; pivots as
        Aseprite writes them: meta.slices = one slice "pivot" with a key per frame index,
        {"frame": N, "bounds": {"x": 0, "y": 0, "w": W, "h": H}, "pivot": {"x": X, "y": Y}},
        bounds = the whole frame, pivot relative to it, "pivot" left out for a frame without)
      --tiled: sheet PNG + Tiled tileset JSON with per-tile animations (worlds: help worlds)
      (--aseprite x.json and --tiled x.tsj write the same x.png)
      FILE:SEL exports only those frames; several selectors of one file add up, in file
      order: 'export harbor.px:cobble harbor.px:water --tiled t.tsj' (no 32x32 props).
      Several files and directories export together, file by file in the order named; a
      directory stands for every .px under it (palette files skipped, --exclude as for
      sheet): 'export town/ --frames out/'. No two frames may get one name: an id two files
      share (each file's idle/0; two animations of one name too), or, with --frames, two ids
      that differ only in case (Door, door: one file on macOS), is E_DUP_FRAME, and nothing
      is written. --prefix-file ids them FILE/ID, FILE being the file's path under its
      directory without .px, or a named file's stem (roofs/roof-red, props/well/well; an
      unnamed grid is FILE alone), in the PNG paths, the Aseprite filenames and tags and the
      Tiled animations.
      Id order (the Aseprite frame index, the Tiled tile id, the sheet position): 0, 1, 2...
      over the exported frames, file by file, with each animation group contiguous, groups
      in order of first appearance, and all top-level frames (no '/' in the id) together as
      one group where the first of them appears. A file that keeps each group together, and
      its top-level frames together, gets ids in file order; otherwise a frame moves up to
      its group: a/0 b/0 a/1 -> a/0=0 a/1=1 b/0=2, and icon walk/0 badge -> icon=0 badge=1
      walk/0=2. Adding, removing or moving frames can renumber others, and a Tiled map
      painted with the old tileset keeps the old ids.

See also, in pxart help all: FORMAT: frames and animation (@frame ids, groups, @anim);
  FORMAT: pivots and timing (pivot=x,y, direction, repeat, ms); FORMAT: still groups (@still
  GROUP, @still *); FORMAT: variants (@variant, %VARIANT); FORMAT: selecting frames
  (FILE:SEL, an unnamed grid's name, zsh's "${F}:sel").

pxart help all has the whole reference, pxart help TOPIC one part of it.

This is the output of pxart help export. The other converting commands and their shared notes are in pxart help CONVERTING.

This page is built from site/src/data/reference.json in the repository.Edit on GitHub