PIXFILTER(1)

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

πŸ’… PIXFILTER(1) β€” the BRL-CAD glow-up filter πŸ’…

okay bestie, grab a snack, because this one is literally the "make my image look different" tool and it's giving main character energy ✨


🌸 NAME 🌸

pixfilter β€” applies a 3x3 kernel filter to a color pix file πŸŽ€


✨ SYNOPSIS ✨

pixfilter [-v] [-f type] [-d div] [-o offset] [-w width] [-n height] [-s squaresize] [file.pix] > newfile.pix

πŸ’– DESCRIPTION πŸ’–

so basically, pixfilter convolves a 3x3 kernel filter over a color pix(5) format image πŸ¦‹. It reads from the named file.pix, or from standard input if you don't name one, and writes the result straight to standard output. slay.

The outermost rows and columns? They get copied through untouched β€” no filtering, no drama, they're just vibing as-is πŸ’….

Also, heads up: the input is assumed to be 512x512 pixels unless you pass -w, -n, or -s. No cap. A low-pass filter is what you get by default; you pick other kernels with -f πŸŽ€.

Now for the ✨math✨ part, and it's actually important so listen up: each kernel divides the convolved result by a divisor to keep values in the 0–255 range (the boxcar average, for instance, divides by nine, bestie). Some kernels also add an offset. The Laplacian is centered about zero, so it adds 128 to express a difference from neutral grey 🌈. And because you're the main character, the -d and -o options override a kernel's built-in divisor and offset whenever you feel like it πŸ’œ.


🫢 OPTIONS 🫢

  • -v β€” verbose mode, bb ✨. Prints the kernel values and the resulting minimum and maximum pixel values on standard error.
  • -f type β€” picks the filter kernel πŸ‘‘. The recognized type values are lo (low pass, which is the default), hi (high pass), la (Laplacian), hg (horizontal gradient), vg (vertical gradient), and b (boxcar average).
  • -d div β€” divides the convolved result by div instead of the kernel's default divisor. It must be non-zero β€” like, don't even try it πŸ’€.
  • -o offset β€” adds offset to the result instead of the kernel's default offset.
  • -w width β€” sets the input scanline width in pixels (default 512).
  • -n height β€” sets the number of scanlines in the input (default 512).
  • -s squaresize β€” sets both width and height to squaresize pixels. one number, two jobs, iconic πŸŽ€.
  • -h, -? β€” prints a usage message, including the list of filter types, and exits. your lil' help button πŸ¦‹.

🌈 EXAMPLES 🌈

Example 1. Edge detection on a rendered image

rt -s 1024 -o scene.pix scene.g all.g
pixfilter -s 1024 -f la scene.pix > edges.pix

here's the tea β˜•: this renders a 1024x1024 image with rt(1), then applies the Laplacian kernel to produce an edge-emphasized image whose values are centered on neutral grey β€” which is literally so useful for highlighting object boundaries. ate and left no crumbs πŸ”₯.


πŸ’œ SEE ALSO πŸ’œ

brlcad(1), pix3filter(1), pixscale(1), rt(1), pix(5)

go read those too, iykyk πŸ’…


πŸ™ˆ BUGS πŸ™ˆ

This should allow any 3x3 kernel to be specified directly. (ngl, we're manifesting that for a future release ✨)


πŸ‘‘ 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 β€” they genuinely wanna hear from you, bestie, so don't be shy πŸ’–


fr fr, don't forget the > newfile.pix redirect or your filtered pixels will just spill onto your terminal and that's a whole vibe check you don't want 😭

k bye ily, this has been the PIXFILTER(1) page from the BRL-CAD manual πŸ’…βœ¨ see you in the next one, and remember: outer rows and columns are literally just copy-pasted through untouched, periodt πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from