BWFILTER(1)

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

πŸ’… BWFILTER(1) β€” the BRL-CAD glow-up filter πŸ’…

okay bestie, so this page lives in the BRL-CAD manual set, and it's all about <pink>bwfilter</pink> β€” your new fave little tool for making black-and-white images look different. buckle up πŸŽ€


✨ NAME ✨

bwfilter β€” slaps a 3x3 kernel filter onto a black and white bw image. that's it, that's the whole vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

bwfilter [-v] [-f _type_] [-d _div_] [-O _offset_] [-s _squaresize_] [-w _width_] [-n _height_] [-o _out_file.bw_] [_file.bw_]

πŸ’– DESCRIPTION πŸ’–

so bwfilter convolving... no wait, it convolves a 3x3 kernel filter over a black and white bw(5) format image. yes it's giving math class but make it cute 🧚

here's the tea: it reads from file.bw, or from standard input when you don't hand it a file, and it writes the filtered result to standard output (or to the file you name with -o). and the outer rows and columns of the image are left untouched β€” those edges are staying exactly as they are, no cap βœ‹

by default the input is assumed to be 512x512 pixels, and a low pass filter gets applied. every built-in filter has an associated divisor that scales the convolved result back into the 0-255 range, and, for some filters, an offset that recenters the result β€” and bestie, both of those are overridable. iconic.


🌸 OPTIONS 🌸

  • -f type β€” picks which filter to apply (default is lo). the recognized types are, and I quote the whole squad:
    • lo β€” low pass
    • hi β€” high pass
    • vg β€” vertical gradient
    • hg β€” horizontal gradient
    • la β€” laplacian
    • b β€” boxcar average (low pass)
  • -d div β€” overrides the kernel divisor. most filters divide the result of the kernel multiplication by a fixed value to scale it into a 0-255 range (the boxcar filter, for example, divides by nine). 🚨 a divisor of zero is rejected β€” do not try it, it's giving undefined chaos.
  • -O offset β€” overrides the kernel offset. some filters add an offset to their results; the laplacian, for instance, is centered about zero and adds 128 to yield a difference from neutral grey. lowkey clever 🫢
  • -s squaresize β€” sets both the width and height of the input image to squaresize. one number, two jobs, multitasking queen πŸ‘‘
  • -w width β€” sets the width of the input image to width (default 512).
  • -n height β€” sets the height of the input image to height (default 512).
  • -o out_file.bw β€” writes the filtered output to out_file.bw. and if standard output is also non-interactive (redirected or piped), the same output gets written to both destinations. two places at once, main character energy πŸ’…
  • -v β€” verbose! prints the kernel values and the maximum and minimum output values to standard error. for the girlies who need to see the receipts πŸ‘€

πŸ”₯ EXAMPLES πŸ”₯

Example 1. Sharpen an image with a high pass filter

bwfilter -f hi -s 1024 image.bw > sharp.bw

applies a high pass filter to the 1024x1024 image image.bw and redirects the result to sharp.bw, accentuating edges and fine detail. crisp. sharp. slay ✨

Example 2. Detect edges and view the result

bwfilter -f la moon.bw | bw-pix | pix-fb

runs a laplacian edge detector over moon.bw, converts the resulting black and white image to pix(5) with bw-pix(1), and displays it on a framebuffer with pix-fb(1) β€” without writing any intermediate file. pipeline perfection, no notes πŸ“


πŸ’€ BUGS πŸ’€

this should allow any arbitrary 3x3 kernel to be specified on the command line. (it does not. we're manifesting πŸ™ˆ)


🌈 SEE ALSO 🌈

brlcad(1), bwmod(1), bwscale(1), pixfilter(1), bw(5)


πŸŽ€ AUTHOR πŸŽ€

BRL-CAD Team β€” the collective geniuses behind all this 🫢


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 'em you sent yourself, bestie 😭


and that's the whole page, mwah πŸ’‹ β€” signed off from the BRL-CAD manual set, page BWFILTER(1), stamped in that 2026 copyright era. go filter something iconic πŸ’œ

πŸ“¦ where this page comes from