PIX-BW(1)

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

πŸ’… 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 -o while standard output is also redirected or piped, the same bw(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 to squaresize pixels. 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. type can be one of these beauties:
    • ntsc β€” Rec. ITU-R BT.601-7 NTSC primaries, weights 0.299/0.587/0.114
    • crt β€” historic CRT phosphors with D6500 white, weights 0.26/0.66/0.08
    • hdtv β€” Rec. ITU-R BT.709, weights 0.2126/0.7152/0.0722
    • hdr β€” Rec. ITU-R BT.2020, weights 0.2627/0.6780/0.0593
    • avg β€” simple average of the three planes 🌸
  • -R red_weight β€” select the red plane and apply red_weight to it.
  • -G green_weight β€” select the green plane and apply green_weight to it.
  • -B blue_weight β€” select the blue plane and apply blue_weight to it.
⚠️ okay this is the important footnote, don't skip it: if a weight of 0 is supplied to any of -R, -G, or -B, the selected planes are instead weighted equally as 1.0 divided by the number of planes selected. so 0 doesn't mean "zero out this plane", it means "actually, equal split bestie" 🫢
  • -o out_file.bw β€” write the output to the named bw(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


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