Reference · Editing
pxart crop
Cut a rectangle out of one frame into a frame of its own, in the same file or another.
crop FILE:frame x,y,w,h -o OUT[:frame] [--rekey [KEYS]] [--used-keys-only] [--variant-map NAME=V1,V2]
usage: pxart crop [-h] -o O [--rekey [KEYS]] [--variant-map NAME=V1,V2] [--used-keys-only]
[--dry-run]
src rect
crop FILE:frame x,y,w,h -o OUT[:frame] [--rekey [KEYS]] [--used-keys-only]
[--variant-map NAME=V1,V2]
Cut a rectangle out of one frame into a frame of its own, in the same file or another.
positional arguments:
src
rect
options:
-h, --help show this help message and exit
-o O
--rekey [KEYS] give keys that clash with OUT's colors free keys in OUT only; the source files stay as they are. KEYS: only these ('o,r'), or KEY=OUTKEY to use OUT's key ('k=j,n=q')
--variant-map NAME=V1,V2 OUT's variant NAME takes each source's first of NAME, V1, V2 (repeatable)
--used-keys-only a new OUT gets only the keys the frame uses (default: the sources' whole palettes, for shade ramps)
--dry-run print what the edit says and a diff of the file it would change; write nothing
Cut the w x h rectangle at x,y out of one frame into a frame of its own: 'crop
hero.px:idle/0 4,0,8,8 -o parts.px:head'. The pixels left outside get no note (they're
what crop is for); a rectangle that runs past the frame's edge (or starts at a
negative x,y) gets '.' there. FILE:frame must be one .px frame.
OUT is written as compose writes it, FILE's frame its one layer (see compose): a new
OUT gets FILE's whole palette (--used-keys-only: the cut's keys), OUT:frame adds or
replaces that frame in an existing OUT, and a plain OUT with one unnamed grid has it
replaced. A key OUT has in another color is E_KEY_CONFLICT, with free keys; --rekey
gives the cut those keys in OUT and leaves FILE as it is.
See also, in pxart help all: compose (OUT's palette, frame placement, E_KEY_CONFLICT,
--rekey); EDITING (-o OUT gets the whole file, only changed lines are rewritten, 'no
change'); 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 crop. The other editing commands and their shared notes are in pxart help EDITING.
This page is built from
site/src/data/reference.json in the repository.Edit on GitHub