Halftoning Basics


Most printers and certain displays are capable of producing only a limited number of levels of intensity in their output.  Most laser printers, for example, only allow for a binary output of black or white for any given pixel location.  Most color deskjets employ 4 colors of ink to produce the wide range of colors visible to the human eye.  Halftoning takes advantage of the spatial resolution limitations of the eye to achieve the effect of multiple intensity levels by combining discrete values over a number of pixel locations.

Halftoning methods have been used in lithographic prining for both color and grayscale images for most of the 20th century.  Early engravers would use various line widths and dot patterns to simulate shade intensities in metal and wood carvings.  Lithographic halftones were originally achieved by taking high contrast photos of original images through fine screens.  When digital displays and printers were first used with computers, new methods for producing half-tomed images of grayscale images were developed.

Dither Matrix

A dither matrix consis of a pattern of theshold values that can be compared to the original image intensities to determine the discrete output for the halftoned image.  Sometimes a dither matrix is composed to produce a regular pattern of size-varying dots.  Inkjet printing usually employs a dither matrix more similar to the one suggested by Bayer [1], which arranges the increasing threshold values in a pattern meant to minimize low-frequency pattern visibility.

Here is Bayer's optimal dither matrix in matrix form.  Note that all thresholds are represented by increasing integers, and could be divided by 32 to find the actual threshold used to test each pixel.

         [  1  17   5  21   2  18   6  22
           25   9  29  13  26  10  30  14
            7  23   3  19   8  24   4  20
B =        31  15  27  11  32  16  28  12
            2  18   6  22   1  17   5  21
           26  10  30  14  25   9  29  13
            8  24   4  20   7  23   3  19
           32  16  28  12  31  15  27  11 ]
 

Show below is a  continuous tone grey ramp and a depiction of that ramp as rendered by Bayer's
matrix tiled over this image.



 

Error Diffusion

Error diffusion is a different method of producing a halftone pattern.  Unlike the repeated pattern used with a dither matrix, an error diffusion system is used as a series of pixel-to-pixel calls, producing a less regualr variation across uniform shades.  Each value at a given pixel is rounded to the nearest discrete level -- in the binary case of black and white, this would be either 0 or 1.  The difference between the actual value and this estimate is then passed on to future pixels.  As the next pixel is evaluated, the error from the last estimate is added to the current pixel's value, perhaps giving a lighter pixel more of a chance to round to 1, or vice versa.  In this way, the overall average of a region of a middle insensity will be preserved as the average of its 0 and 1 values.  To prevent regualr patterns, matrices for splitting and sharing the error among all pixels yet to be printed were developed and perfected by recearches such as Floyd and Steinberg [2].

The error diffusion pattern recommended by Floyd and Steinberg is:
 
 

      [ 0  0  0
ED =    0  0  7
        3  5  1 ]
 

Below is the same grey ramp used to demonstrate Bayer's halftoning method and a version with Floyd-Steinberg error diffusion applied:


 
 

Continue to Color Halftoning

Return to Index