pixclump — quantize the colors in a pix(5) stream
pixclump reads an input stream of pix data, converts each pixel to one of a set of specified colors, and writes out these quantized pixels.
may be specified
either on the command line,
option per color,
or in a file specified with the
Each pixel in the input stream is compared to all of the specified colors and replaced on the output by the specified color most resembling it. pixclump computes the difference between an input pixel and a specified color as the sum of the squares of the differences in their respective red, green, and blue channels.
option may be used to selectively enable
various diagnostic print statements.
A typical use for pixclump is in renormalizing an image. For example, if a tool such as pixscale has been used to transform an image containing a relatively small number of colors, pixclump will change pixels whose colors have been interpolated back to one of the original colors.
This software is Copyright (c) 1997-2016 by the United States Government as represented by U.S. Army Research Laboratory.