BWSTAT(1)
π
bwstat(1) β ok so this is the BRL-CAD manual page for bwstat, bestie
πΈ NAME
bwstat β literally just shows you the stats of a black and white image. that's it. that's the whole vibe. β¨
π SYNOPSIS
bwstat [-v] [file.bw]
π DESCRIPTION
okay so picture this: bwstat reads a bw(5) format file β or, if you're feeling mysterious, standard input β and then it goes absolutely feral computing statistics of the pixel intensities. no cap, it gives you everything:
- the total number of pixels
- the file dimensions (and yes, it assumes the image is square, just so we're clear π«Ά)
- minimum and maximum values
- mean, median, and mode (plus its pixel count, king behavior)
- variance, standard deviation, and skew
it's giving statistics professor but make it cute. π
β¨ OPTIONS β¨
-vβ verbose mode, bestie. after the statistics it prints the full histogram of pixel values: every single intensity from0to255, its pixel count, and its percentage of the total. it's a lot but like. in a good way. π-h,-?β prints a usage message and dips. iconic exit behavior. πfile.bwβ optional input file! if you don't hand it one,bwstatjust reads from standard input. no pressure. no demands. so chill. π¦
π₯ EXAMPLES
Example 1. Summarize the intensity distribution of an image
bwstat moss.bw
reports the pixel count, inferred square dimensions, minimum, maximum, mode, median, mean, standard deviation, variance, and skew for the intensities in moss.bw. that's the whole squad of stats. π
Example 2. Inspect a histogram piped from another tool
pix-bw scene.pix | bwstat -v
this one converts a color pix(5) image to black and white using pix-bw(1) and pipes it straight into bwstat, which prints the statistics followed by the complete 0-255 histogram β and it does all of this without writing an intermediate file. no clutter, no mess, no leftover files rotting in your directory. we love a clean workspace. β
π§ METHOD
so here's the tea: since the pixel values are quantized (meaning they have discrete values from 0 to 255), the statistics can be computed from "lump sums" after building a histogram of the input. translation? it's a significant savings in computation, and it means a single pass over the input file is sufficient. one pass. one vibe. efficiency queen. π
π¦ SEE ALSO
brlcad(1), bwhist(1), pix-bw(1), pixstat(1), bw(5)
go read those too, iykyk π
π AUTHOR
BRL-CAD Team β the icons behind it all π«Ά
π COPYRIGHT
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. so like. respect the paperwork. π
π BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. found a problem? don't suffer in silence bestie, email them fr fr π
π reminder: the image is assumed square for the dimension math. that's not me being dramatic, that's literally in the description. π«Ά
k bye, this page was brought to you by BRL-CAD's BWSTAT(1) β source and version BRL-CAD, section 1, from the era of 1989 all the way to 2026. slay, stay statistical, and may all your histograms be complete. β¨ππ
π¦ 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