PNG-BW(1)

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

πŸ’… png-bw(1) β€” the BRL-CAD glow-up machine

okay so bestie, listen: this is the png-bw page from BRL-CAD and it's literally about turning your cute little PNG into a single-channel BW file. no cap, that's the whole vibe. let's get into it ✨

🌸 NAME 🌸

png-bw β€” convert a PNG (Portable Network Graphics) file to a BW (black and white) file πŸ–€πŸ€

πŸŽ€ SYNOPSIS πŸŽ€

png-bw [-v] [-ntsc] [-crt] [-R[#]] [-G[#]] [-B[#]] [in.png] > out.bw

πŸ¦‹ DESCRIPTION πŸ¦‹

so png-bw reads a PNG image from the file you name β€” or straight from standard input if you don't name one β€” and writes out a single-channel bw(5) image to standard output. that's it, that's the job πŸ’–

the way it handles your pixels depends on what you fed it:

  • if the input is already grayscale, the data gets passed through directly. iconic, no notes, zero drama ✨
  • if the input is a color image, it gets reduced to black and white. glow-down time πŸ’…

by default all three color planes are weighted equally. but the flags let you change how the weighting works:

  • -ntsc applies the standard NTSC luminance weights, based on the NTSC primaries and the D6500 white.
  • -crt applies weights for typical CRT phosphor chromaticities and the D6500 white.

you can also hand-pick individual color planes with the -R, -G, and -B flags πŸ‘‘

  • if a flag is immediately followed by a value, that value is used as the weight applied to that plane.
  • a selected plane with no explicit weight is implicitly given a weight of 1.0 divided by the number of selected planes. math! we love her πŸ”₯

✨ OPTIONS ✨

  • -v β€” Verbose. reports the color type, bit depth, image dimensions, gamma, background color, interlacing, and any text or timestamp metadata β€” all to standard error. she's nosy and we respect it πŸ’œ
  • -ntsc β€” Use NTSC luminance weights: red 0.30, green 0.59, blue 0.11. πŸ“
  • -crt β€” Use typical CRT phosphor weights: red 0.26, green 0.66, blue 0.08. πŸ“Ί
  • -R[#] β€” Select the red plane, optionally with an explicit weight (e.g. -R0.30). 🌹
  • -G[#] β€” Select the green plane, optionally with an explicit weight (e.g. -G0.59). 🌿
  • -B[#] β€” Select the blue plane, optionally with an explicit weight (e.g. -B0.11). 🫐

🌈 EXAMPLES 🌈

⭐ Example 1. Convert a color rendering to grayscale and view it

png-bw -ntsc render.png > render.bw
bw-pix render.bw | pix-fb -w 512 -n 512

this reduces a color PNG to a perceptually weighted grayscale bw(5) image using NTSC luminance weights, then converts it back to pix(5) and displays it on a framebuffer with pix-fb(1). full pipeline, main character energy πŸ‘‘πŸ’–

⭐ Example 2. Blend selected color planes with custom weights

png-bw -R0.30 -G0.59 -B0.11 file.png > file.bw

this combines the red, green, and blue planes with the given weights β€” and it produces the same result as the -ntsc flag. fr fr. 😭✨

and if you select planes without weights, like in png-bw -R -B file.png, those planes get blended equally. simple, clean, slay πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

brlcad(1), png-pix(1), bw-png(1), pix-png(1), bw-pix(1), pix(5), bw(5)

go read those too, iykyk πŸ¦‹

🫢 AUTHOR 🫢

BRL-CAD Team πŸ’œ

This software is Copyright (c) 1998-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 πŸ“¬


okay that's the whole page, bestie! this one ships as part of BRL-CAD β€” that's the source/version tag at the bottom of the page along with the PNG-BW(1) manual name β€” so go forth, convert your PNGs, and remember: gamma is real and she matters πŸŒΈβœ¨πŸŽ€ bye!! πŸ§šπŸ’–

πŸ“¦ where this page comes from