BWFILTER(1)
π 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 πΈ
-ftype β picks which filter to apply (default islo). the recognized types are, and I quote the whole squad:loβ low passhiβ high passvgβ vertical gradienthgβ horizontal gradientlaβ laplacianbβ boxcar average (low pass)
-ddiv β 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.-Ooffset β 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 π«Ά-ssquaresize β sets both the width and height of the input image to squaresize. one number, two jobs, multitasking queen π-wwidth β sets the width of the input image to width (default 512).-nheight β sets the height of the input image to height (default 512).-oout_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 π«Ά
β 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 β 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
- 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