PIXCMP(1)
π pixcmp β bestie edition π
okay so this is a page from the BRL-CAD manual set, and honestly? it's giving "tiny tool, huge responsibility." buckle up π
β¨ NAME β¨
pixcmp β compare two pix(5) format images pixel by pixel. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
pixcmp [-b] [-s] [-d] [-q] [-i _SKIP_|_SKIP1:SKIP2_] [-n _COUNT_] _FILE1_ [_FILE2_ [_SKIP1_ [_SKIP2_]]]
π DESCRIPTION π
so pixcmp compares two pix(5) format images on a pixel-by-pixel basis and summarizes the differences. because the comparison is per-pixel it is independent of image resolution β literally doesn't care how big your picture is, the pixels get checked one at a time. π₯
each pixel gets sorted into one of four buckets:
- matching β same same π
- off by one in a single channel β so close, one little channel slipped π«Ά
- off by many β a larger or multi-channel difference, big yikes π
- missing β when the files differ in size π
a one-line summary of these counts gets printed to standard output. cute, concise, iconic. β¨
with -b the files are instead compared byte by byte. also you can throw away initial pixels (or bytes) from either input, and you can cap how many pixels (or bytes) get compared; by default comparison runs to the end of the larger input.
if either _FILE_ is - or is omitted, that input is read from standard input. heads up bestie: if both inputs are standard input, the two images' data must be interleaved β no cap, that's just how it is. π
pixels and bytes are indexed linearly from one. skip amounts may be given either via -i or as the trailing positional _SKIP1_ and _SKIP2_ arguments β two ways to say the same thing, pick your fighter. π
π OPTIONS π
-bβ iterate and report by bytes instead of by pixels. _SKIP_ and _COUNT_ values are then interpreted as bytes. whole different unit of measure, same energy. π-sβ print every pixel (or byte) whose values match. yes, all of them. the matching ones. slay for the identical twins. β¨-dβ print every pixel (or byte) whose values differ. the drama report, honestly. π₯-qβ quiet mode. suppresses the header, the size-mismatch warning, and the summary line. shhh, no commentary, just results. π€«-i_SKIP_ β discard the initial _SKIP_ pixels (or bytes with-b) from both inputs. equal skipping, fair. π«Ά-i_SKIP1_:_SKIP2_ β discard the initial _SKIP1_ pixels (or bytes) from _FILE1_ and _SKIP2_ from _FILE2_. asymmetric skipping, no judgment. π-n_COUNT_ β compare at most _COUNT_ pixels (or bytes with-b). the default stops at end of file. π-?,-hβ print a usage message and exit. the classic "help meee" combo. π
π¦ EXIT STATUS π¦
0β no differences were found. perfect match, we love to see it. π1β only single-channel off-by-one differences were found. tiny little whoops, barely anything. πΈ2β off-by-many or missing-pixel differences were found. ok so now we're in our flop era, something's actually wrong. π
π EXAMPLES π
Example 1. Compare a rendered frame against a reference image
rt -s512 moss.g all.g
pixcmp ref/moss.pix moss.pix
after ray tracing a scene with rt(1), compare the resulting pix(5) image against a known-good reference. this is the check the BRL-CAD benchmark uses to confirm that a build produces correct imagery; the exit status reflects whether any pixels differ. literally the vibe check for your build, iykyk. β
Example 2. List differing pixels, ignoring a header
pixcmp -d -i 1024 a.pix b.pix
skip the first 1024 pixels of each input (for example a leading scanline or header region β we don't need that part, it's not the main character) and print each remaining pixel that differs, along with its RGB values from both files. full receipts. π
π SEE ALSO π
brlcad(1), rt(1), pixdiff(1), pix(5)
π AUTHOR π
BRL-CAD Team π
π COPYRIGHT π
this software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β tell them bestie sent you. π§
okay that's the whole page!! π§ this lovely lil doc came to you from BRL-CAD and its version is literally just "BRL-CAD" (the footer and header both say so, no fancy numbered release, we keep it real) β and oh, the date? also nothing but "BRL-CAD" in the footer. mysterious, iconic, we stan a low-key footer. π β¨
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms