PNG-BW(1)
π 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:
-ntscapplies the standard NTSC luminance weights, based on the NTSC primaries and the D6500 white.-crtapplies 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.0divided 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: red0.30, green0.59, blue0.11. π-crtβ Use typical CRT phosphor weights: red0.26, green0.66, blue0.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 π
π COPYRIGHT π
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
- 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