The optimized dither algorithm which CISRA recommends for the 24 inch
panel is a special case of a general class of halftoning algorithms for
multi-level displays.  We describe this class of halftoning algorithms
in this section. 

Any halftoning algorithm for a 2-level display can be used to halftone
for a multi-level display, by using the transformation described below.  
Error diffusion, dithering, or any other method designed for 2-level
displays is suitable.  To explain the required transformation, we first review
conventional 2-level halftoning, and then propose a generalization 
to multi-level halftoning.



Review of 2-Level Halftoning


A pixel in a 2-level display can be either ON or OFF.  It cannot be
1/2 ON and 1/2 OFF, or 1/3 ON and 2/3 OFF.  Assign the intensity value
"0" to OFF, and "1" to ON.  A pixel in a 2-level display cannot display the
intensity value "1/3".  Of course, photographs have all gray scale levels
between 0 and 1, so we desire to approximate these fractional intensities
as closely as possible on a 2-level display.

All halftoning algorithms achieve this by taking advantage of the
tendency of the eye to blur nearby pixels together.  To display
a flat region with intensity 1/3, we turn ON 1/3 of the pixels, 
and we turn OFF 2/3 of the pixels (see figure 2).  This
yields an average intensity of

  average intensity = (1/3)*1 + (2/3)*0 
  
		    = 1/3


The ON and OFF pixels should be spread around evenly to avoid clumping, which 
is very noticeable to the eye.  Exact details of this spreading depend on
the details of the halftoning algorithm.  Dithering and error diffusion
achieve the spreading in very different ways, but they both turn ON the
same number of pixels.  

Regardless of the halftoning algorithm used, to display the intensity
"1/3", 1/3 of the pixels need to be ON, and 2/3 of the pixels need to be OFF.



Generalization to a 4-Level Display


We now consider a display with 4 possible intensity levels (see figure 3).
Assign intensity value "0" to the darkest state, assign the intensity value
"1" to the brightest state.  Assume that the intensities are evenly 
distributed.  In this case, the 4 possible intensity values are
 
  0, 1/3, 2/3, 1














Suppose we wish to display the intensity "4/9".  "4/9" is not one of
the possible display values for our 4-level display, so we must halftone.
We have several choices.  We could do as we did for the 2-level display:
turn 4/9 of the pixels to intensity "1" and 5/9 of the pixels to 
intensity "0" (see figure 4).  This yields the correct average intensity

  average intensity = (4/9)*1 + (5/9)*0

		    = 4/9


This turns out to be a not very good method of halftoning.

A better possibility is to use the intensity "2/3" for
1/3 of the pixels, and the intensity "1/3" for 2/3 of the pixels
(see figure 5).  This also yields the correct average intensity

  average intensity = (1/3)*2/3 + (2/3)*1/3

		    = 4/9


The second method better because it gives less "halftone noise".
"Halftone noise" is the jitter that the viewer perceives about the average
intensity value "4/9".  The viewer still perceives individual pixels; his
eye does not blur them together perfectly.

In the first method, the average jitter is about 1/2.  In the second method, 
the average jitter is about 1/6.  

It is always best to use the 2 nearest display values to the value we
want to display using halftoning.  For example, if we want to display
the intensity "1/2", then we use the display levels "2/3" and "1/3" in our 
halftone (see figure 6).  If we want to display the value "1/9", we
use the display levels "0" and "1/3" (see figure 7).  

Go back to the "4/9" example (see figure 5).  How do we choose which pixels 
to give "2/3" intensity, and which to give "1/3"?  We can use a 2-level 
halftone!  "4/9" is 1/3 of the way from "1/3" to "2/3".  We simply
pretend that we want to halftone the value "1/3" for a 2-level
display.  "ON" in the 2-level halftone corresponds to "2/3" in the multi-level
halftone.  "OFF" in the 2-level halftone corresponds to "1/3" in the
multi-level halftone.




























More details of 4-Level Halftoning
---- ------- -- ------- ----------

We now describe in detail some simple logic to implement the above ideas.
Refer to figure 7.5 for an example of this logic.

  1)  Choose the 2 display values to use for halftoning.  The
      lower display value is the integer part of

	3*input

      We call the lower display value the "quotient".
      The upper display value is the lower display value plus 1.

      In the case previously discussed, we want to display the intensity
      4/9 (see figure 7.5).  Applying our formula:

	quotient = lower_display_value = truncate_to_integer( 3*(4/9) )

	                               = truncate_to_integer( 4/3 )

	                               = 1
	 
      The upper display value is

	upper_display_vale = lower_display_value + 1
	 
			   = 2

  2)  Generate a "remainder", which measures the relative distance between
      the 2 display values of the desired intensity.  The formula is

	remainder = 3*input - quotient

  
      For the example of displaying 4/9 (see figure 7.5), we have

	remainder = 3*(4/9) - 1

		  = 1/3

  3)  Halftone the remainder values using a 2-level halftone.  Add the
      result to the quotient values.  


This logic readily generalizes to any multi-level display.
























Generalization to an N-Level Display
-------------- -- -- ------- -------


We now describe a general halftone method for an N-level display (see
figure 8).

  1)  For each pixel, decompose the desired intensity into 2 numbers: 
   
      a)  A "quotient", which is the nearest intensity level which can be
	  displayed, which is LESS than the desired intensity.
      b)  A "remainder, which is the fractional part remaining after 
	  subtracting the quotient from the desired intensity.

      The quotient is an index of the intensity level.  The remainder
      is scaled to be between 0 and 1.

      The following arithmetic achieves this (in floating point arithmetic):

        quotient = truncate_to_integer( (N-1)*input );
        remainder = (N-1)*(input-quotient/(N-1))
	
  2)  Halftone the "remainder" pixel values using a 2-level halftoning 
      algorithm.  The output of the halftoning algorithm is either 0 or 1.

      Ignore the quotient in this process.

  3)  Add the result from the halftone to the quotient.  This is the 
      display level for the pixel.

	pixel_display_level = quotient + halftone_2_level(remainder)






        Optimized Dither For The 24 Inch FLCD Panel
        ========= ====== === === == ==== ==== =====
	      

The optimized dither algorithm which CISRA recommends for the 24 inch FLCD 
panel is simply a special case of the general class of halftoning algorithms 
for multi-level displays discussed in the previous section.  

The 24 inch panel has 3 colors: red, green, blue.  Each color is
halftoned independently from the other colors.  The 24 inch panel
is designed so that each color has 16 intensity levels, which are 
evenly spaced.  The algorithm discussed in the previous chapter is
applied to each color; the 2-level halftoning algorithm that we recommend
is CISRA optimized dithering.

We use the same dither matrix for all 3 colors, but we have found that
luminance noise decrease slightly if we "invert" the GREEN matrix.  
To invert a dither matrix, we apply this simple formula:

  matrix_for_green[y][x] = 254-matrix[y][x]


The following figure describes how to drive each pixel for a given 
display intensity.

