next up previous
Next: Linear Pixel Shuffling Up: Error Diffusion Using Linear Previous: Error Diffusion Using Linear

Error Diffusion Halftone Production

The error diffusion algorithm transforms a gray scale image, I, with pixel values in the interval [0.0, 1.0], to a black-and-white image, B, with values in $\{0,1\}$. The following pseudocode describes error diffusion:

    for every pixel position i,j in I
       if I[i][j] < 0.5
          then B[i][j] = 0
          else B[i][j] = 1
       error = I[i][j] - B[i][j]
       distribute the error among
       unprocessed neighbors of i,j
The order of pixel visitation generally takes the form of raster processing:
    for ( i = 0; i < i_max; i++ ) {
       for ( j = 0; j < j_max; j++ ) {
          process pixel i,j
       }
    }
The input and output images dimensions are i_max by j_max. Floyd and Steinberg's error diffusion algorithm [4] follows this pixel ordering and distributes the error to four unprocessed neighbors of I[i][j] according to the kernel $D_{\mathit FS}$:

\begin{displaymath}D_{\mathit FS} = \frac{1}{16} \left[
\begin{array}{ccc}
\ & P & 7 \\
3 & 5 & 1
\end{array} \right]
\end{displaymath} (1)

where P denotes the pixel currently being processed.
     I[i][j+1]    += error * 7/16
     I[i+1][j-1]  += error * 3/16
     I[i+1][j]    += error * 5/16
     I[i+1][j+1]  += error * 1/16
This process produces bilevel images with visual appearance capturing the full range and detail of the original image. This is particularly effective in case the original image has a lot of detail. The resulting images do, however, often contain ``worm'' artifacts in very dark and very light regions, and a ``tearing'' or ``checkerboarding'' where the image's original gray value was slowly varying around 0.25, 0.5, or 0.75; see Fig. 1 (our ramp figures are presented here using enlarged pixels-approximately 80dpi--in order to illustrate the results of the algorithms and avoid transformations caused by unknown printing processes; the proper viewing distance is 4-5 feet). Floyd-Steinberg error diffusion was also used to render the ``Woman with French Horn'' in Fig. 2 (approx. 130dpi).
  
Figure: Floyd-Steinberg error diffusion. Notice the ``worm'' artifacts at the ends, and ``tearing'' in the middle. (All the ramp images are $64\times 256$ pixels.)
\begin{figure}\begin{center}
\epsfig{file=fsramp.ps, width=\ImageDim} \end{center} \end{figure}


  
Figure 2: Floyd-Steinberg error diffusion of ``Woman with French Horn'' (image courtesy of Heidelberger Druckmaschinen A. G.).
\begin{figure}\begin{center}
\epsfig{file=fsH1x150.ps, height=\ImageDim} \end{center}
\end{figure}


next up previous
Next: Linear Pixel Shuffling Up: Error Diffusion Using Linear Previous: Error Diffusion Using Linear

2000-04-14