Skip to documentation
DocumentationAll documentsEnglish

PIXFILTER(1)

NAME

pixfilter - apply a 3x3 kernel filter to a color pix file

On this page

SYNOPSIS

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

DESCRIPTION

pixfilter convolves a 3x3 kernel filter over a color pix(5) format image, reading from the named file.pix or from standard input and writing the result to standard output. The outermost rows and columns are copied through untouched. The input is assumed to be 512x512 pixels unless -w, -n, or -s are given. A low-pass filter is used by default; other kernels are selected with -f.

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), and some kernels add an offset. The Laplacian is centered about zero, so it adds 128 to express a difference from neutral grey. The -d and -o options override a kernel’s built-in divisor and offset.

OPTIONS

-v

Verbose; print the kernel values and the resulting minimum and maximum pixel values on standard error.

-f type

Select the filter kernel. Recognized type values are lo (low pass, the default), hi (high pass), la (Laplacian), hg (horizontal gradient), vg (vertical gradient), and b (boxcar average).

-d div

Divide the convolved result by div instead of the kernel’s default divisor. Must be non-zero.

-o offset

Add offset to the result instead of the kernel’s default offset.

-w width

Set the input scanline width in pixels (default 512).

-n height

Set the number of scanlines in the input (default 512).

-s squaresize

Set both width and height to squaresize pixels.

-h, -?

Print a usage message, including the list of filter types, and exit.

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

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, useful for highlighting object boundaries.

SEE ALSO

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

BUGS

This should allow any 3x3 kernel to be specified directly.

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