![](bg2.png)
Next, for each pixel in the input image, we
calculate the Euclidean distance from its RGB value to
the RGB value of each of the 48 available colors in the
color palette (note that each RGB value may be
viewed as a 3-dimensional vector), and select a color
with the smallest Euclidean distance. If there is more
than one color with the same smallest distance, we
select one from these colors with the smallest
Euclidean distance from their HSB (Hue, Saturation,
and Brightness) values to the HSB value of the pixel.
Figure 2 (b) shows the result of this process.
(a) (b) (c)
Figure 2: Size of these images: 50 pixels wide and 67 pixels
high. (a) Input image. (b) The image with reduced color
using the limited color palette. (c) The image produced by
Floyd-Steinberg dither .
This process is likely to yield color bandings and
patches that produce dramatically different visual
effect from the input image (as shown in Figure 2 (b))
because of color reduction. To enhance the visual
quality of the image, we need to find ways to conceal
or minimize these artifacts. This process is referred to
as color quantization.
Dithering is a useful technique to transform an
image of continuous tone to an image of limited given
colors. A number of dithering algorithms have been
devised during the past three decades, including
threshold dithering, random dithering, pattern
dithering, and error-diffusion dithering. Error
diffusion dithering intends to diffuse the quantization
error of a given pixel to its neighboring pixels.
Published in 1975, Floyd and Steinberg’s error
diffusion dithering algorithm (Floyd and Steinberg,
1975), referred to as FSD, has been the most popular
dithering algorithm. It uses a set of values of 1/16,
5/16, 3/16, and 7/16 to diffuse a pixel’s error to its
lower left, lower, lower right, and right neighbors,
respectively, producing a dithering image shown in
Figure 2 (c).
Listed below are a number of other error-diffusion
methods.
Coefficient error diffusion dithering. Jarvis,
Judice, and Nink (
Judice and Ninke, 1976
) devised a
dithering algorithm using a much more complex
error diffusion coefficient matrix than the one used in
FSD. Shiau and Fan’s dithering algorithms (
Shiau and
Fan, 1993
), Stucki’s dithering algorithm (
Stucki, 1981
),
Burkes’ dithering algorithm (
Daniel Burkes, 1988
), and
Atkinson’s dithering algorithm (
Atkinson, 2003)
all
use different sets of error diffusion coefficient
matrices.
Changing image parsing direction. Dithering is
often carried out by scanning a pixel one at a time,
from left to right and from top to bottom. Other
parsing directions may be applied. For example, one
may parse an image following a serpentine path
using the FSD error diffusion coefficient matrix,
instead of parsing it line by line or with a space-
filling curve (
Riemersma, 1998
).
Variable coefficients error diffusion.
Ostromoukhov (
Ostromoukhov, 2001
) proposes to use
variable error diffusion coefficent matrix based on
the input image.
Block error diffusion and sub-block error
diffusion. Both algorithms parse image four pixels at
a time, which were proposed by Damera-Venkata
and Evans (
Damera-Venkata and Evans, 2001
),
respectively. The sub-block error diffusion improves
block error diffusion, using four 2 × 2 error diffusion
matrices for pixels contained in one block.
Reported in (Caca Labs., 2010), the serpentine
dithering, block dithering, and sub-block dithering
tend to produce poorer image quality than FSD.
Hocevar and Niger (Hocevar and Niger, 2008)
confirmed that the original FSD coefficients were
indeed amongst the best possible for raster scan.
However, as observed by others and confirmed by
our studies, FSD still contains a number of
drawbacks. For example, FSD tends to produce
noticeable visually distributing artifacts in highlight
and dark areas. More ever, on certain intensity levels
close to ½, 1/3, 2/3, ¼, and ¾, patches of regular
structure are likely to appear. Uneven transitions
between “structure” and unstructured” areas may be
clearly visible (Ostromoukhov, 2001).For example,
as shown in Figure 2 (c), Mona Lisa’s right eye
displays a serious defect—it is much narrower than
that shown in Figure 2 (a) and (b), which makes the
right eye look like half closed.
FSD parses an image in raster scan. Observed by
Hocevar and Niger (Hocevar and Niger, 2008) and
confirmed by our experiments, errors in FSD tend to
propagate to the lower-left direction of each pixel or
to the lower-right direction. Thus, the output image
may look tilted. We observe from a large number of
imaging experiments that the image parsing direction
is crucial in error diffusion. This is probably due to
the fact that, once a pixel completely diffuses
IMAGAPP 2011 - International Conference on Imaging Theory and Applications
126