HOME

TheInfoList



OR:

Error diffusion is a type of
halftoning Halftone is the reprographic technique that simulates continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect.Campbell, Alastair. ''The Designer's Lexicon''. ©2000 Chronicl ...
in which the quantization residual is distributed to neighboring
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a Raster graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
s that have not yet been processed. Its main use is to convert a multi-level image into a
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two values (0 and 1) for each digit * Binary function, a function that takes two arguments * Binary operation, a mathematical op ...
image, though it has other applications. Unlike many other halftoning methods, error diffusion is classified as an area operation, because what the algorithm does at one location influences what happens at other locations. This means buffering is required, and complicates parallel processing. Point operations, such as ordered
dither Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data, and is ofte ...
, do not have these complications. Error diffusion has the tendency to enhance edges in an image. This can make text in images more readable than in other
halftoning Halftone is the reprographic technique that simulates continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect.Campbell, Alastair. ''The Designer's Lexicon''. ©2000 Chronicl ...
techniques.


Early history

Richard Howland Ranger received United States
patent A patent is a type of intellectual property that gives its owner the legal right to exclude others from making, using, or selling an invention for a limited period of time in exchange for publishing an sufficiency of disclosure, enabling discl ...
1790723 for his
invention An invention is a unique or novelty (patent), novel machine, device, Method_(patent), method, composition, idea, or process. An invention may be an improvement upon a machine, product, or process for increasing efficiency or lowering cost. It m ...
, "Facsimile system". The patent, which issued in 1931, describes a system for transmitting
image An image or picture is a visual representation. An image can be Two-dimensional space, two-dimensional, such as a drawing, painting, or photograph, or Three-dimensional space, three-dimensional, such as a carving or sculpture. Images may be di ...
s over telephone or telegraph lines, or by radio.Richard Howland Ranger, "Facsimile system". United States Patent 1790723, issued 3 February 1931. Ranger's invention permitted continuous-tone
photograph A photograph (also known as a photo, or more generically referred to as an ''image'' or ''picture'') is an image created by light falling on a photosensitivity, photosensitive surface, usually photographic film or an electronic image sensor. Th ...
s to be converted first into black and white, then transmitted to remote locations, which had a pen moving over a piece of paper. To render black, the pen was lowered to the paper; to produce white, the pen was raised. Shades of
gray Grey (more frequent in British English) or gray (more frequent in American English) is an intermediate color between black and white. It is a neutral or achromatic color, meaning that it has no chroma. It is the color of a cloud-covered s ...
were rendered by intermittently raising and lowering the pen, depending upon the
luminance Luminance is a photometric measure of the luminous intensity per unit area of light travelling in a given direction. It describes the amount of light that passes through, is emitted from, or is reflected from a particular area, and falls wit ...
of the gray desired. Ranger's invention used capacitors to store charges, and
vacuum tube A vacuum tube, electron tube, thermionic valve (British usage), or tube (North America) is a device that controls electric current flow in a high vacuum between electrodes to which an electric voltage, potential difference has been applied. It ...
comparators to determine when the present luminance, plus any accumulated error, was above a threshold (causing the pen to be raised) or below (causing the pen to be lowered). In this sense, it was an analog version of error diffusion.


Digital era


Floyd-Steinberg

Floyd and Steinberg described a system for performing error diffusion on
digital Digital usually refers to something using discrete digits, often binary digits. Businesses *Digital bank, a form of financial institution *Digital Equipment Corporation (DEC) or Digital, a computer company *Digital Research (DR or DRI), a software ...
images based on a simple kernel : \frac \begin - & \# & 7 \\ 3 & 5 & 1 \end where "-" denotes a pixel in the current row which has already been processed (hence diffusing error to it would be pointless), and "#" denotes the pixel currently being processed. "-" can be seen as no error diffused or "0"


Jarvis, Judice and Ninke

Nearly concurrently, J. F. Jarvis, C. N. Judice, and W. H. Ninke of
Bell Labs Nokia Bell Labs, commonly referred to as ''Bell Labs'', is an American industrial research and development company owned by Finnish technology company Nokia. With headquarters located in Murray Hill, New Jersey, Murray Hill, New Jersey, the compa ...
disclosed a similar method, which they termed "" using a larger kernelJ. F. Jarvis, C. N. Judice, and W. H. Ninke, "A survey of techniques for the display of continuous tone pictures on bilevel displays". Computer Graphics and Image Processing, 5:1:13–40 (1976). : \frac \begin - & - & \# & 7 & 5 \\ 3 & 5 & 7 & 5 & 3 \\ 1 & 3 & 5 & 3 & 1 \end


Ostromoukhov's Variable Error Diffusion

Later, Victor Ostromoukhov introduced a variable error diffusion method, which enhances dithering quality by dynamically adjusting the diffusion coefficients based on the color values of the pixel’s RGB channels. The algorithm employs a serpentine scan instead of a traditional raster scan and modifies the error buffer, leading to better dithering results. According to his paper, this technique achieves a blue-noise characteristic while maintaining lower computational complexity. However, despite its advantages, the method did not gain widespread adoption at the time and was largely forgotten in later years. \frac \begin - & \# & R \\ DL & D & - \end where "R" denotes the right weight, "DL" denotes the down-left weight, "D" denotes the down weight, and "sum" represents the total of all weights.


Algorithm description

Error diffusion takes a monochrome or color image and reduces the number of quantization levels. A popular application of error diffusion involves reducing the number of quantization states to just two per channel. This makes the image suitable for printing on binary printers such as black and white laser printers. In the discussion which follows, it is assumed that the number of quantization states in the error diffused image is two per channel, unless otherwise stated.


One-dimensional error diffusion

The simplest form of the algorithm scans the image one row at a time and one pixel at a time. The current pixel is compared to a half-gray value. If it is above the value a white pixel is generated in the resulting image. If the pixel is below the half way brightness, a black pixel is generated. Different methods may be used if the target palette is not monochrome, such as thresholding with two values if the target palette is black, gray and white. The generated pixel is either full bright, or full black, so there is an error in the image. The error is then added to the next pixel in the image and the process repeats. The kernel for one-dimensional error diffusion is : 1 \begin \# & 1 \\ - & - \end Or vertically : 1 \begin \# & - \\ 1 & - \end


Two-dimensional error diffusion

One-dimensional error diffusion tends to have severe image artifacts that show up as distinct vertical lines. Two-dimensional error diffusion reduces the visual artifacts. The simplest algorithm is exactly like one-dimensional error diffusion, except that half the error is added to the next pixel, and half of the error is added to the pixel on the next line below. The kernel for two-dimensional error diffusion is : \frac \begin \# & 1 \\ 1 & - \end Further refinements can be made by:   - Dispersing the error over a larger area (as seen in the matrices in the "Digital era" section). - Using a serpentine scan to reduce more artifacts. The sample image at the start of this article is an example of two-dimensional error diffusion.


Color error diffusion

The same algorithms may be applied to each of the red, green, and blue (or cyan, magenta, yellow, black) channels of a color image to achieve a color effect on printers such as color laser printers that can only print single color values. However, better visual results may be obtained by first converting the color channels into a perceptive
color model In color science, a color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components. When this model is associated with a precise description ...
that will separate lightness, hue and saturation channels, so that a higher weight for error diffusion will be given to the lightness channel, than to the hue channel. The motivation for this conversion is that human vision better perceives small differences of lightness in small local areas, than similar differences of hue in the same area, and even more than similar differences of saturation on the same area. For example, if there is a small error in the green channel that cannot be represented, and another small error in the red channel in the same case, the properly weighted sum of these two errors may be used to adjust a perceptible lightness error, that can be represented in a balanced way between all three color channels (according to their respective statistical contribution to the lightness), even if this produces a larger error for the hue when converting the green channel. This error will be diffused in the neighboring pixels. In addition,
gamma correction Gamma correction or gamma is a Nonlinearity, nonlinear operation used to encode and decode Relative luminance, luminance or CIE 1931 color space#Tristimulus values, tristimulus values in video or still image systems. Gamma correction is, in the s ...
may be needed on each of these perceptive channels, if they don't scale linearly with the human vision, so that error diffusion can be accumulated linearly to these gamma-corrected linear channels, before computing the final color channels of the rounded pixel colors, using a reverse conversion to the native non gamma-corrected image format and from which the new residual error will be computed and converted again to be distributed to the next pixels.


Error diffusion with several gray levels

Error Diffusion may also be used to produce output images with more than two levels (per channel, in the case of color images). This has application in displays and printers which can produce 4, 8, or 16 levels in each image plane, such as electrostatic printers and displays in compact mobile telephones. Rather than use a single threshold to produce binary output, the closest permitted level is determined, and the error, if any, is diffused as described above.


Printer considerations

Most printers overlap the black dots slightly, so there is not an exact one-to-one relationship to dot frequency (in dots per unit area) and
lightness Lightness is a visual perception of the luminance (L) of an object. It is often judged relative to a similarly lit object. In colorimetry and color appearance models, lightness is a prediction of how an illuminated color will appear to a stand ...
. Tone scale linearization may be applied to the source image to get the printed image to look correct.


Edge enhancement versus lightness preservation

{{unreferenced section, date=September 2023 When an image has a transition from light to dark, the error-diffusion algorithm tends to make the next generated pixel be black. Dark-to-light transitions tend to result in the next generated pixel being white. This causes an edge-enhancement effect at the expense of gray-level reproduction accuracy. This results in error diffusion having a higher apparent resolution than other
halftone Halftone is the reprographic technique that simulates continuous tone, continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect.Campbell, Alastair. ''The Designer's Lexicon''. ...
methods. This is especially beneficial with images with text in them, such as the typical facsimile. This effect shows fairly well in the picture at the top of this article. The grass detail and the text on the sign is well preserved, and the lightness in the sky, containing little detail. A cluster-dot
halftone Halftone is the reprographic technique that simulates continuous tone, continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect.Campbell, Alastair. ''The Designer's Lexicon''. ...
image of the same resolution would be much less sharp.


See also

* Floyd–Steinberg dithering *
Halftone Halftone is the reprographic technique that simulates continuous tone, continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect.Campbell, Alastair. ''The Designer's Lexicon''. ...


References


External links


Error diffusion in Matlab
Printing terminology Image processing