BW-D(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’– bw-d(1) β€” BRL-CAD πŸ’–

okay bestie, welcome to the bw-d(1) page β€” this is the BRL-CAD era of turning black-and-white bytes into double-precision binary, and it’s lowkey iconic. πŸ¦‹

✨ NAME ✨

bw-d β€” convert black-and-white unsigned bytes to double-precision binary. literally what it says on the tin, no cap. πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

here’s the whole mood:

bw-d [-n | scale] < unsigned_chars > doubles

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bw-d reads a stream of unsigned 8-bit bytes from standard input β€” think the pixel values of a bw(5) black-and-white image β€” and writes a stream of machine-native double-precision (8-byte) binary floating point values to standard output. it’s giving raw binary pipeline princess. ✨

By default, every byte is copied to its corresponding double value unchanged, from 0 to 255. If a numeric scale argument is supplied, every value is multiplied by that factor before output. The -n option is the shorthand glow-up: it normalizes the data by scaling the 0-255 input range to the 0.0-1.0 floating point range. 🫢

Because the output is raw binary, bw-d refuses to run when standard input is a terminal. yes, it’s protecting you from a terminal full of mystery bytes, bestie 😭. The inverse conversion β€” from binary doubles back to unsigned bytes β€” is performed by d-bw(1).

⚠️ heads up: this command is deprecated and is scheduled for removal. it prints a deprecation warning on startup. so enjoy the vibe, but don’t build your whole personality on it, fr fr. πŸ’€

πŸ’… OPTIONS πŸ’…

  • -n β€” normalize the data by scaling the 0-255 input byte range to the 0.0-1.0 output range (equivalent to a scale of 1/255). very clean, very demure ✨
  • scale β€” multiply every input byte by this floating point factor before writing it. defaults to 1.0 (a straight 0-255 copy). Cannot be combined with -n. pick a lane, bestie πŸ’€
  • -h, -? β€” print a usage message and exit. the β€œhelp me help you” icon behavior 🫢

🌈 EXAMPLES 🌈

πŸ“ Example 1. Normalize a black-and-white image to the 0.0-1.0 range

bw-d -n < image.bw > image.d

Converts every pixel byte in image.bw to a double in the range 0.0 to 1.0, producing a normalized binary double stream suitable for signal processing tools such as dmod(1) or dstats(1). slay for signal processing. πŸ”₯

🧚 Example 2. Scale and round-trip through the double pipeline

bw-d 0.5 < image.bw | dmod -a 0.1 | d-bw > brighter.bw

Converts the image to doubles at half intensity, adds a constant offset with dmod(1), and converts the result back to a black-and-white byte stream with d-bw(1). a full round-trip glow-up, no cap. πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, bestie:

πŸŽ€ AUTHOR πŸŽ€

BRL-CAD Team β€” iconic. periodt. πŸ‘‘

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. yes bestie, 1989-2026, we love a long-running era. πŸ’œ

πŸ¦‹ BUG REPORTS πŸ¦‹

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β€” don’t suffer in silence, bestie. πŸ“¬


okay that’s the whole page! source/version footer vibes: BRL-CAD, manual page BW-D(1) β€” and there’s no date printed in this footer, just those two, so that’s the cute sign-off, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from