Reference · Checking

pxart diff

Compare renders pixel by pixel (a frame, a file, a folder of PNGs) and exit 1 when they differ: proof that a port or a copy renders as its original. -o DIFF.png draws what differs.

diff A B [--variant V] [--strict-alpha] [--exclude GLOB] [-o DIFF.png|DIR [--scale N]] [--labels CSV [--label-col C] [--file-col C]]
usage: pxart diff [-h] [--variant VARIANT] [--strict-alpha] [--labels FILE.csv] [--label-col COL]
                  [--file-col COL] [--exclude GLOB] [-o DIFF.png|DIR] [--scale N]
                  a b

  diff A B [--variant V] [--strict-alpha] [--exclude GLOB] [-o DIFF.png|DIR [--scale N]]
       [--labels CSV [--label-col C] [--file-col C]]
      Compare renders pixel by pixel (a frame, a file, a folder of PNGs) and exit 1 when they differ:
      proof that a port or a copy renders as its original. -o DIFF.png draws what differs.

positional arguments:
  a
  b

options:
  -h, --help         show this help message and exit
  --variant VARIANT  render both with this variant (a side's own %variant wins)
  --strict-alpha     compare all four channels even where alpha is 0 (by default any two transparent pixels match)
  --labels FILE.csv  a directory's PNGs go by the names this CSV gives them, as from-png's --labels (repeatable)
  --label-col COL    with --labels: the column of names (default proposed_name)
  --file-col COL     with --labels: the column of PNG file names (default filename)
  --exclude GLOB     a directory of .px: leave out files whose name or path under it matches GLOB, or under a matching directory (repeatable)
  -o DIFF.png|DIR    picture A, B and the differing pixels in magenta; with several pairs, DIR gets one per pair that differs
  --scale N          with -o: default 8, or less to keep the picture within 2048 px wide

      Compare renders pixel by pixel, one line per pair ('same: 16x16, every pixel', or what
      differs: '12 px differ in 3,4,6,6 (x,y,w,h)', 'sizes 16x16 and 16x24') and for several a
      count ('132 frame(s): 130 same, 1 differ, 1 unpaired'). It exits 1 when anything differs
      or has no pair, as check does.
      A and B are:
        two files, FILE[:SEL][%VARIANT] or PNGs: one frame each, or frames paired by id (in
          order when their ids differ but their counts match: diff wick.px:walk
          party.px:wick/walk, copies made with --prefix wick/);
        a file and a directory of PNGs: each frame against DIR/<id>.png, as export --frames
          writes them, or with --labels CSV against the PNG whose row names it so: 'diff
          town.px pack/ --labels pack/labels.csv' proves a port lossless in one call;
        a directory of .px files and one of PNGs: every frame of every .px, as above ('diff
          town/ pack/ --labels pack/labels.csv'; an id two files share is E_BAD_ARG; a note
          counts the PNGs left over);
        two other directories: the .png and .px files under them paired by path (with
          --labels, a PNG goes by its row's name), a .px pair frame by frame.
      A frame with no PNG, or a file only one side has, is unpaired. --exclude GLOB leaves
      a directory's files out, as for check.
      Transparency: a pixel whose alpha is 0 matches any other whose alpha is 0, whatever
      its rgb; any other pixel compares on all four channels. --strict-alpha compares all
      four everywhere. --variant V renders both sides with V, and a side's own %VARIANT
      wins. -o DIFF.png draws A, B and the differing pixels in magenta side by side
      (top-left aligned) of the one pair that differs; -o DIR gets one per pair that differs.
      A render or scaled copy of a frame gets a note naming render --plain.

See also, in pxart help all: 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 diff. The other checking commands and their shared notes are in pxart help CHECKING.

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