pixbgstrip — strip smooth shaded background from a pix(5) file


pixbgstrip [-a] [-t thresh] [-x x_offset_for_bg_pixel] [-s squarefilesize] [-w file_width] [-n file_height] [file.pix]


pixbgstrip reads a pix(5) format file from the named file, or from standard input if no file is specified. For each scanline read, all pixels that match the color of the background pixel are converted to black (0/0/0), and then the new scanline is written on stdout.

The default X offset for the background pixel is zero (i.e. -x 0 ), but if the pixel at X offset zero is not the desired background (for example, if a border exists around the actual image), then another offset can be specified.

By default, a pixel will be replaced with black only if it exactly matches the value of the background pixel (i.e., the matching threshold is zero; -t 0 ). However, if the background is slightly noisy, it may be necessary to perform a slightly looser matching. The threshold variable specifies how large a difference between an input pixel and the background pixel will still result in black being output.

By default, the pix file is assumed to be 512x512 pixels. Specifying the -a flag causes the program to attempt to autosize. A table of common image sizes is consulted, and if any match the size of the input file, then the width and height values associated with that size will be used.

The -w file_width flag specifies the width of each scanline in the input file, in pixels.

The -n file_height flag specifies the height in scanlines of the input file.

-s squarefilesize sets both the height and width to the size given.


pixbackgnd(1), pix-fb(1), fb-pix(1), libfb(3), pix(5)


If the pix file is shorter than expected, the program exits silently.




This software is Copyright (c) 1991-2016 by the United States Government as represented by U.S. Army Research Laboratory.


Reports of bugs or problems should be submitted via electronic mail to <>.