BWHIST(1)

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

πŸŽ€ BWHIST(1) β€” the histogram glow-up for your bw files πŸŽ€

okay so bestie, bwhist is from the BRL-CAD fam, and it's literally the moment your black-and-white image gets its vibe check on a framebuffer. let's get into it πŸ’…


✨ NAME ✨

bwhist β€” display a histogram of a black and white bw file on a framebuffer 🌈


πŸ¦‹ SYNOPSIS πŸ¦‹

bwhist [-v] [file.bw]

πŸ’– DESCRIPTION πŸ’–

so here's the tea: bwhist calculates and displays a histogram of the pixel values in a bw(5) format file. if you don't specify a file, no worries β€” it just reads from standard input, lowkey chill like that 🫢

the histogram shows up on the framebuffer selected via the FB_FILE environment variable (peep libfb(3) for the deets), and it's opened at 512x512.

the relative frequency of each pixel value gets drawn as a horizontal bar of white pixels along the x-axis ✨ and it's scaled so that the most frequent value spans the full width of the screen β€” main character bar energy, honestly πŸ‘‘. the 256 pixel values map to the y-axis, with 0 (black) at the bottom and 255 (white) at the top. iconic vertical arrangement, no cap.

and the pixel count corresponding to a full-width bar? it's always reported to standard output as a Full screen = N pixels line. every single time. that's the rule πŸ“


πŸ’… OPTIONS πŸ’…

  • -v β€” Verbose mode, bestie! in addition to displaying the histogram, this prints each pixel value, its count, and its relative frequency to standard output. πŸ—£οΈ but heads up: it must appear before the optional file argument. order matters, fr fr.
  • -h, -? β€” Print a usage summary and exit. the classic "wait how does this work again" escape hatch πŸ™ˆ

🌸 EXAMPLES 🌸

Example 1. Inspect the tonal distribution of a rendered image 🌟

pix-bw scene.pix > scene.bw
bwhist -v scene.bw

okay so what's happening here: it converts a color pix(5) image to black and white with pix-bw(1), then displays its intensity histogram on the framebuffer while dumping the per-value counts and frequencies to the terminal. πŸ–₯️✨

and like, the printed table is genuinely so useful β€” it makes it easy to spot clipping at 0 or 255 and to judge overall exposure before adjusting a render. it's giving "I actually know what I'm doing" energy πŸ’€πŸ”₯


πŸ”₯ SEE ALSO πŸ”₯

brlcad(1), bwhisteq(1), bwstat(1), bw(5)


πŸ’€ BUGS πŸ’€

this program assumes the framebuffer has at least 512 scanlines to display the full histogram (that's 2 lines per pixel value). so if your framebuffer is shorter than that… yeah, it's giving "not enough room for the whole vibe" 😭 plan accordingly!


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team 🫢


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 πŸ“§


and that's the whole page, bestie β€” go forth and histogram πŸ’œ

signing off: this lil doc is part of BRL-CAD, and it's dated with the BRL-CAD release info β€” catch you on the framebuffer side 🧚✨

πŸ“¦ where this page comes from