PIXELSWAP(1)
okay so welcome to pixelswap(1) from the BRL-CAD manual, bestie β this one is a tiny little color-swap icon and we're gonna get into it π
β¨
πΈ NAME πΈ
pixelswap β interchange two pixel colors in a pix image π
π¦ SYNOPSIS π¦
pixelswap [-d _pixeldepth_] _r_ _g_ _b_ _R_ _G_ _B_ < input.pix > output.pix
π DESCRIPTION π
okay so pixelswap reads a stream of RGB pix(5) data from standard input and exchanges two specific colors named on the command line. The way that works: any pixel matching the first color (r g b) is rewritten as the second color (R G B), and any pixel matching the second color is rewritten as the first. All other pixels are passed through to standard output unchanged. slay, simple swap, no cap π«Ά
Each of the six color components is an integer in the range 0-255. Literally all six, bestie β count them.
π¨ redirect BOTH sides, fr fr: both standard input and standard output must be redirected. pixelswap refuses to run if either is a terminal. it's giving "no terminal shenanigans" and honestly periodt π
Although a pixel depth may be specified with -d, the current implementation always processes 3-byte RGB pixels and ignores the requested depth. so yeah, the depth request is lowkey just vibing there π
β¨ OPTIONS β¨
-d pixeldepthβ Number of bytes per pixel (must be a positive integer). Accepted for forward compatibility but currently ignored; pixels are always treated as 3-byte RGB.-h,-?β Print a usage message and exit.
π EXAMPLES π
Example 1. Recolor a rendered frame
rt -o frame.pix scene.g region > /dev/null
pixelswap 255 0 0 0 0 255 < frame.pix > swapped.pix
Ray traces a model with rt(1), then swaps every pure-red pixel for pure-blue and every pure-blue pixel for pure-red, producing swapped.pix. This is a quick way to re-key flat region colors without re-rendering the scene. iconic little workflow, honestly π
π SEE ALSO π
π 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 π«Ά
okay that's the whole page, bestie π β source/version sign-off: BRL-CAD and PIXELSWAP(1), and the footer date is not listed on this one. 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