BW-A(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… bw-a β€” NAME ✨

okay so this is bw-a(1), and it lives in the BRL-CAD manual fam πŸ’– β€” its whole thing is converting a BRL-CAD BW image into an ASCII bitmap. that's it, that's the job, and it does it iconically.


🌸 SYNOPSIS

bw-a [-a] [-s squaresize] [-w file_width] [-n file_height] [file.bw] > file.abm

like, you feed it stuff and it slaps characters at your terminal πŸŽ€


πŸ¦‹ DESCRIPTION

so bw-a reads a BRL-CAD BW(5) grayscale image and writes an ASCII bitmap out to standard output β€” one character per pixel, no cap, fr fr 🫢

the rules are simple bestie:

  • pixels with a value below 127 come out as #
  • brighter pixels come out as -
  • a newline gets inserted after every file_width characters, so every scanline of the image becomes one line of text ✨

if file.bw isn't specified, the image gets read from standard input instead β€” very chill of it πŸ’…

by default the input width is assumed to be 512 pixels. you can override that with the -w option, or let it figure the width out automatically with -a πŸ”₯

heads up: the image is treated as being in inverse (bottom-to-top) order, so it's typically flipped before conversion. not a bug, just the vibe 😭

the output is suitable for feeding to the X11 atobm(1) utility to create an X bitmap πŸ‘‘


✨ OPTIONS ✨

  • -a β€” autosize the input 🧚 when a named file is given, the width gets determined from the file size rather than the default or supplied dimensions. main character energy.
  • -s squaresize β€” accepted for compatibility, but lowkey has no effect on the output. only the input width (see -w) is used when emitting scanlines. it's giving decorative πŸŽ€
  • -w file_width β€” set the width of the input to file_width pixels (default 512). a newline is emitted after every file_width characters. this is the one that actually does stuff πŸ’–
  • -n file_height β€” accepted for compatibility, but has no effect on the output. the number of scanlines is determined solely by the amount of input read. again: decorative πŸ¦‹
  • -h, -? β€” print a usage message and exit. the classic escape hatch πŸ™ˆ

🌈 EXAMPLES

Example 1. Convert a halftoned image into an X11 bitmap ⭐

$ pix-fb -w1280 -n960 -i -Fimage.pixi image.pix
$ pix-bw image.pixi | halftone -R -S -w1280 -n960 | \
      bw-a -w1280 -n960 | atobm -name image >image.bm

okay so what's happening here, step by step, because it's a lot and it ate πŸ’…

it flips a 1280x960 color image, converts it to grayscale, halftones it to a one-bit-per-pixel representation, turns that into an ASCII bitmap with bw-a, and finally pipes the result through atobm(1) to produce a usable X bitmap. iconic pipeline, no notes πŸ‘‘


πŸ’œ SEE ALSO

brlcad(1), bw-pix(1), bw-png(1), halftone(1), pix-bw(1), bw(5)

go read those too, iykyk πŸ“


πŸ‘‘ AUTHOR

BRL-CAD Team β€” absolute legends tbh 🫢


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 β€” don't be shy, they're nice about it πŸ’–


so yeah, that's the whole page bestie 🌸 this was bw-a(1) from the BRL-CAD collection, dated with that 1989-2026 copyright span up there ☝️ β€” slay, go convert some pixels πŸ’…βœ¨

πŸ“¦ where this page comes from