halftone [-RSa] [-s squarefilesize] [-w file_width] [-n file_height] [-B contrast] [-I Number_Intensity_Levels] [-M Method] [-T Tone_Scale_Curve_Points] [-D debug_level] < file.bw
By default, the bw file is assumed to be 512x512 pixels.
If the -R flag is specified, random noise is added to the dither, and this can sometimes improve the results.
The -S flag causes a surpentine raster to be used rather than a left to right scan.
The -a flag is used when automatic file sizing is wanted. This does not work on pipes.
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.
-B contrast 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 sharpening.
-I Levels defines the number of different intensity levels to use on output. The default is 2 (1 bit) and the max is 256 (8 bits).
-M method 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.
The -T 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 curve is -T 0 0 128 128 255 255; a curve suggested by Robert Ulichney in Digital Halftoning is -T 0 0 15 0 128 100 200 200 240 255 255 255.
-D debug_level supplies the debug level; setting the argument to 9 provides all debugging.
The output from halftone is scaled so that each intensity level is output as 255/Levels*value.