BWSTAT(1)

πŸ“¦
version 7.44.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… 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 from 0 to 255, 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, bwstat just 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 🫢


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