BW-A(1)
π 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.-ssquaresize β 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 π-wfile_width β set the width of the input to file_width pixels (default512). a newline is emitted after every file_width characters. this is the one that actually does stuff π-nfile_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 π«Ά
π 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 β 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
- 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