PIX-BW(1)
π
PIX-BW(1) β a.k.a. pix-bw, the gluon between color and greyscale β¨
okay so real quick, bestie: this is a page from the BRL-CAD manual set, and it's all about turning your gorgeous full-color pix pics into moody little black-and-white bw files. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
pix-bw β convert a color pix image into a black and white bw image π
π SYNOPSIS π
pix-bw [-s squaresize] [-w width] [-n height] [-e ntsc|crt|hdtv|hdr|avg] [-R red_weight] [-G green_weight] [-B blue_weight] [-o out_file.bw] [[<] file.pix] [> out_file.bw]
π¦ DESCRIPTION π¦
pix-bw takes a pix(5)-format image β either from standard input or from a file you name β and combines or selects its color planes, then spits out an 8-bit greyscale bw(5) image on standard output. literally the color-to-grey pipeline, no cap π
By default, the red, green, and blue planes are all weighted equally. that's the no-flags situation. but you've got options, queen π:
- pick a standard weighting scheme with
-e - or hand-pick arbitrary per-plane weights with
-R,-G, and-B
and here's the cute part: if you only pass a subset of -R, -G, and -B, the result gets computed from just those planes. so yeah, you can absolutely isolate one channel if that's your vibe π
one lil' thing to know, bestie: if the output is written to a named file with-owhile standard output is also redirected or piped, the samebw(5)image gets written to both destinations. two for the price of one, she's generous like that β¨
π OPTIONS π
-s squaresizeβ sets both the width and height of the input image tosquaresizepixels. one flag, two dimensions, efficiency icon behavior π-w widthβ sets the width of each scanline of the input image, in pixels.-n heightβ sets the height of the input image, in scanlines.-e typeβ use a standard luminance weighting scheme.typecan be one of these beauties:ntscβ Rec. ITU-R BT.601-7 NTSC primaries, weights0.299/0.587/0.114crtβ historic CRT phosphors with D6500 white, weights0.26/0.66/0.08hdtvβ Rec. ITU-R BT.709, weights0.2126/0.7152/0.0722hdrβ Rec. ITU-R BT.2020, weights0.2627/0.6780/0.0593avgβ simple average of the three planes πΈ
-R red_weightβ select the red plane and applyred_weightto it.-G green_weightβ select the green plane and applygreen_weightto it.-B blue_weightβ select the blue plane and applyblue_weightto it.
β οΈ okay this is the important footnote, don't skip it: if a weight of0is supplied to any of-R,-G, or-B, the selected planes are instead weighted equally as1.0divided by the number of planes selected. so0doesn't mean "zero out this plane", it means "actually, equal split bestie" π«Ά
-o out_file.bwβ write the output to the namedbw(5)file instead of (or in addition to) standard output.-h,-?β print a usage message and exit. our little helper π§
π₯ EXAMPLES π₯
Example 1. Convert a color image to greyscale using NTSC luminance weighting
pix-bw -e ntsc < image.pix > image.bw
Produces a perceptually weighted greyscale bw(5) image, giving green the most influence and blue the least, matching standard NTSC luminance. green really said main character energy π
Example 2. Extract a single color plane
pix-bw -G1.0 -w 512 -n 512 scene.pix | bw-pix > green.pix
Selects only the green plane of a 512x512 image and pipes the resulting bw(5) image through bw-pix(1) to view the isolated green channel as a greyscale pix(5) image. solo green era, we love to see it πΏ
β SEE ALSO β
brlcad(1), bw-pix(1), pix(5), bw(5)
π AUTHOR π
BRL-CAD Team
π 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 π§
and that's the whole page, bestie π this one ships out as part of the BRL-CAD manual set β that's the source and version tag living down in the footer, no separate date stamp on this one (iconic minimalism, honestly). now go make something greyscale and gorgeous β¨ππ¦
π¦ 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