halftone — Translate a bw file to a halftoned bw file
halftone [-RSa ] [-s
halftone reads a bw(5) format file from the named file, or from standard input if no file is specified, and reduces the number of intensity levels from 256 to a default of 2. halftone tries to preserve as much information as possible by applying dither.
By default, the bw file is assumed to be 512x512 pixels.
flag is specified, random noise is added to the dither, and this can sometimes
improve the results.
flag causes a surpentine raster to be used rather than a left to right
flag is used when automatic file sizing is wanted. This does not work on
flag specifies the width of each scanline in the input file, in pixels.
flag specifies the height in scanlines of the input file.
sets both the height and width to the size given.
will define a floating point value to be used as the Beta portion
of a edge sharpening algorithm. The default is 0.0, which is no
defines the number of different intensity levels to use on output. The
default is 2 (1 bit) and the max is 256 (8 bits).
allows a choice of dither methods. The default is
0 a Floyd-Steinberg diffused error dither,
1 is a 45 degree classical clustered halftone screen,
2 is a simple threshold dither,
3 is a 0 degree dispersed halftone screen.
x1 y1 x2 y2 ...
parameter is used to define a curve to be used as a tone scale. The
resulting curve is used to map input pixels to output pixels. The default
-T 0 0 128 128 255 255;
a curve suggested by Robert Ulichney in
-T 0 0 15 0 128 100 200 200 240 255 255 255.
supplies the debug level; setting the argument to 9 provides all debugging.
A bw(5) file contains sequences of pixels. Each pixel is stored as one unsigned char. The first pixel in a bw file is the lower left corner of the image. The pixels proceed from left-to-right across each scanline, with scanlines being written from the bottom to the top of the image.
The output from halftone is scaled so that each intensity level is output as 255/Levels*value.
This software is Copyright (c) 1990-2016 by the United States Government as represented by U.S. Army Research Laboratory.