BW-PIX(1)

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

πŸ’… BW-PIX(1) β€” the BRL-CAD glow-up zone ✨

okay so bestie, welcome to bw-pix, one of the BRL-CAD girlies πŸŽ€ this whole page is about her, so grab a strawberry drink πŸ“ and let's go


✨ NAME ✨

bw-pix β€” the icon who converts a black and white image, or three color channels, into a color pix image 🌈 like she literally takes monochrome and gives it main character energy, no cap


πŸ¦‹ SYNOPSIS πŸ¦‹

bw-pix [-h] [-o _out.pix_] [_file.bw_ [_out.pix_]]
bw-pix [-h] [-o _out.pix_] _red.bw_ _green.bw_ _blue.bw_ [_out.pix_]

two whole forms, she's versatile like that πŸ’…


πŸ’– DESCRIPTION πŸ’–

so bw-pix converts one or more black and white bw(5) files into a color pix(5) file. she's got two modes, and which one you get depends on how many input files you hand her. it's giving choose-your-own-adventure 🧚

Mode one: single input πŸŽ€ β€” with a single input file (or when she's reading from standard input), each input value gets replicated three times, so all three RGB planes hold the same value. result? a grayscale image, but stored in pix format. same vibes, new container, periodt.

Mode two: three inputs πŸ¦‹ β€” with three input files, they are read concurrently and treated as the red, green, and blue channels (in that order, iykyk) and their bytes are interleaved into a single color pix image. and here's the detail that matters: channels of unequal length are zero-padded to the length of the longest. so nobody gets left out 😭🫢

output goes to the file named by -o, or to a final positional filename, or to standard output if neither is given. and the lowkey wild part: when an output file is named and standard output is also redirected, the result is written to both. two destinations, one queen πŸ‘‘

with no input file at all? input is read from standard input. she's flexible fr fr.


🌸 OPTIONS 🌸

  • -o out.pix β€” write the color pix output to out.pix. you can also just hand it over as the final positional argument instead, whatever feels right πŸ’« and if standard output is simultaneously redirected or piped, the same data is written to both destinations β€” yes bestie, both. don't say I didn't warn you 🫢
  • -h, β€”help β€” print a usage message and exit. the classic "help me help you" moment, iconic, we love her ⭐

πŸ”₯ EXAMPLES πŸ”₯

Example 1. Convert a grayscale image to pix

bw-pix moon.bw moon.pix

converts the grayscale image moon.bw into moon.pix, with the grayscale value copied into each of the red, green, and blue planes. one value, three homes, slay πŸŒ™βœ¨

Example 2. Recombine separated color channels into a viewable image

bw-pix red.bw green.bw blue.bw | pix-fb

merges the three single-channel bw(5) files red.bw, green.bw, and blue.bw into a color pix(5) image and displays it on a framebuffer with pix-fb(1). this is genuinely useful when you're filtering individual color channels (for example with bwmod(1)) before recombining them πŸ”₯ like splitting the group chat and then putting it back together, no cap


πŸ‘‘ SEE ALSO πŸ‘‘

brlcad(1), pix-bw(1), bwmod(1), pix-fb(1), pix(5), bw(5)

the whole friend group πŸ’œ go say hi


πŸŽ€ AUTHOR πŸŽ€

BRL-CAD Team β€” legends, honestly 🫢


This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. fr fr, that's the real text, keep it safe πŸ’–


πŸ› BUG REPORTS πŸ›

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org πŸ“§ if something's broken, tell the girlies, don't suffer in silence 😭


okay that's the whole page bestie, you're literally an expert now πŸ’…βœ¨

remember: two modes, three channels max, and the output can go to two places at once β€” that's the vibe check βœ…

signing off from the BRL-CAD corner of the universe πŸ¦‹ this was BW-PIX(1) from BRL-CAD β€” version-and-date energy included, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from