Home

FloydSteinberg

Floyd–Steinberg is a dithering algorithm used in image processing to convert grayscale or color images to a limited palette, such as black and white or a small set of colors, while preserving perceived tonal detail. It belongs to the family of error diffusion methods, where the quantization error from each processed pixel is distributed to neighboring pixels that have yet to be processed.

The method processes the image in a raster scan order (left to right, top to bottom). For

Developed by Robert W. Floyd and Louis Steinberg and introduced in 1976, the algorithm became one of

each
pixel,
the
algorithm
assigns
it
the
nearest
color
from
the
target
palette
and
computes
the
quantization
error
as
the
difference
between
the
original
and
the
quantized
value.
This
error
is
then
distributed
to
adjacent
future
pixels
using
a
fixed
kernel:
7/16
of
the
error
to
the
pixel
to
the
right
(x+1,
y),
3/16
to
the
bottom-left
(x-1,
y+1),
5/16
to
the
pixel
below
(x,
y+1),
and
1/16
to
the
bottom-right
(x+1,
y+1).
The
sum
of
the
weights
equals
1,
ensuring
the
global
brightness
is
approximately
preserved.
the
most
widely
used
error-diffusion
techniques
due
to
its
simplicity
and
high-quality
halftone
appearance.
While
it
is
computationally
efficient
and
produces
smooth
gradients,
it
can
produce
visible
patterns
or
artifacts
in
large
flat
regions
or
with
certain
palette
choices.
It
is
applicable
to
both
grayscale
and
color
images,
with
the
diffusion
applied
independently
to
each
color
channel
or
using
a
perceptually
weighted
color
space.