BWDIFF(1)
π bwdiff(1) β the bestie guide to black-and-white file diffing π
πΈ NAME πΈ
bwdiff β compare two black and white files. Thatβs it, thatβs the name, and itβs iconic. β¨
πΈ SYNOPSIS πΈ
bwdiff [-b] [-m | -g | -l | -e | -n] file1 file2
π«Ά DESCRIPTION π«Ά
Okay so bwdiff compares two black and white bw(5) format files and writes the results to standard output. By default, bwdiff records the differences as offsets from a neutral, half-intensity grey (128). The written value is brighter than this neutral grey by an amount proportional to the signed difference between the pixels in file1 and file2. Pixels that are brighter in file1 than in file2 will be brighter than the neutral grey, while pixels that are dimmer in file1 than in file2 will be dimmer. This difference is divided by two to fit the 0 to 255 output range. Math but make it pixel drama, fr fr. π
bwdiff also accepts - as a synonym for standard input, and . as a synonym for the platformβs null device. Lowkey handy, highkey slay. π¦
Note that this program also produces useful results on color pix(5) files. Not me being multifunctional. π
β¨ OPTIONS β¨
-mβ calculates the magnitude of the difference. No offset or division is applied. Brighter pixels indicate larger differences in value, and black indicates no difference. Itβs giving pure difference energy. π₯-gβ greater-than relational operation. Outputs a full-white (255) pixel if the value of the pixel infile1is greater than the corresponding pixel infile2. Cannot be combined with other relational flags. Pick one relational flag, bestie β no chaotic polycule of flags. π-lβ less-than relational operation. Outputs a full-white (255) pixel if the value of the pixel infile1is less than the corresponding pixel infile2. Cannot be combined with other relational flags. Periodt. π-eβ equal-to relational operation. Outputs a full-white (255) pixel if the value of the pixel infile1is equal to the corresponding pixel infile2. Cannot be combined with other relational flags. Matchy-matchy but make it Unix. π-nβ not-equal-to relational operation. Outputs a full-white (255) pixel if the value of the pixel infile1is not equal to the corresponding pixel infile2. Cannot be combined with other relational flags. The βwe are not the sameβ flag, literally. π-bβ sets the background to the corresponding pixels offile1at a lowered intensity instead of the default black background. This option only applies when using one of the relational operation flags (-g,-l,-e, or-n). So donβt try it solo, iykyk. π«Ά
π EXAMPLES π
π Example 1. Basic Difference π
To find the difference between two black and white images:
bwdiff image1.bw image2.bw > diff.bw
π Example 2. Relational Operation on Color Images π
Suppose you ran pixstat(1) on a file and found the modes to be red=107, green=93, blue=70. You can display those pixels whose colors are exactly at these values by comparing the file against a solid color stream:
gencolor 107 93 70 | bwdiff -e file.pix - | pix-fb
π SEE ALSO π
Go read these, bestie, iykyk:
π AUTHOR π
BRL-CAD Team β iconic, fr fr. π
π 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. Please do that, bestie β bug reports are self-care. ππ
BRL-CAD Β· bwdiff(1) Β· source/version sign-off, bestie β no date in the footer, so no invented date, periodt π
π¦ 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