0% found this document useful (0 votes)
242 views23 pages

Halftone

Newspaper photographs appear greyscale despite being printed with black ink only. This is achieved through halftoning, a process that replaces each pixel with a pattern of black dots. The size of the dots creates the illusion of different shades of grey to the human eye. Traditional halftoning uses a halftone screen to project dot patterns photographically. Digital techniques like dithering and error diffusion replace pixels with patterns from a binary font or threshold against a dither matrix to distribute errors among surrounding pixels, producing a halftoned image of the same size as the original.

Uploaded by

av
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
242 views23 pages

Halftone

Newspaper photographs appear greyscale despite being printed with black ink only. This is achieved through halftoning, a process that replaces each pixel with a pattern of black dots. The size of the dots creates the illusion of different shades of grey to the human eye. Traditional halftoning uses a halftone screen to project dot patterns photographically. Digital techniques like dithering and error diffusion replace pixels with patterns from a binary font or threshold against a dither matrix to distribute errors among surrounding pixels, producing a halftoned image of the same size as the original.

Uploaded by

av
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23

Halftoning

Newspaper photographs simulate a greyscale, despite the fact that they have been printed using only black ink. A newspaper picture is, in fact, made up of a pattern of tiny black dots of varying size. The human visual system has a tendency to average brightness over small areas, so the black dots and their white background merge and are perceived as an intermediate shade of grey.

The process of generating a binary pattern of black and white dots from an image is termed halftoning. In traditional newspaper and magazine production, this process is carried out photographically by projection of a transparency through a 'halftone screen' onto film. The screen is a glass plate with a grid etched into it. Different screens can be used to control the size and shape of the dots in the halftoned image.

A fine grid, with a 'screen frequency' of 200-300 lines per inch, gives the image quality necessary for magazine production. A screen frequency of 85 lines per inch is deemed acceptable for newspapers.

5.1 Patterning
A simple digital halftoning technique known as patterning involves replacing each pixel by a pattern taken from a 'binary font'. Figure 5. 1 shows such a font, made up of ten 3 x 3 matrices of pixels. This font can be used to print an image consisting of ten grey levels.

Halftone Approximation
Technique: Dithering Idea: create meta-pixels, grouping base pixels into 3x3s or 4x4s Example: a 2x2 dither matrix for grayscale

5
Pics/Math courtesy of Dave Mount @ UMD-CP

Fig. 5.1. A 3 x 3 binary font for printing a greyscale.

A pixel with a grey level of 0 is replaced by a matrix containing no white pixels; a pixel with a grey level of 1 is replaced by a matrix containing a single white pixel; and so on. Note that, since we are replacing each pixel by a 3 x 3 block of pixels, both the width and the height of the image increase by a factor of 3. Figure 5. 2 shows an example of halftoning using the binary font depicted in Figure 5. 1.

Fig.5.2 Halftoning with a binary font. (a) 8-bit image (b) halftoned image

Halftone Approximation
Issues with Dithering
Image is now 4x in size

How do we keep image the same size? Technique: Error Diffusion Idea: When approximating pixel intensity, keep track of error and try to make up for errors with later pixels
9
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #1


Problem: draw 1D line with 1/3 gray tone Pixel #1: round to black, 0 error 1/3 Pixel #2: value 1/3+1/3=2/3, color white Pixel #3: value 1/3-1/3=0, color black Pixel #4: value 1/3+0= 1/3, color black Color sequence: 01001001001
10
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #1


Draw 1/3 gray line
Pixel: 1/3 1/3 1/3 1/3 1/3 1/3 1/3 1/3 Error: 0 1/3 -1/3 0 1/3 -1/3 0 1/3 FB: 0 1 0 0 1 0 0 1
Color sequence: 01001001001
11
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation
Issues with Dithering
Image is now 4x in size

How do we keep image the same size? Technique: Error Diffusion Idea: When approximating pixel intensity, keep track of error and try to make up for errors with later pixels
12
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #1


Problem: draw 1D line with 1/3 gray tone Pixel #1: round to black, 0 error 1/3 Pixel #2: value 1/3+1/3=2/3, color white Pixel #3: value 1/3-1/3=0, color black Pixel #4: value 1/3+0= 1/3, color black Color sequence: 01001001001
13
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #1


Draw 1/3 gray line
Pixel: 1/3 1/3 1/3 1/3 1/3 1/3 1/3 1/3 Error: 0 1/3 -1/3 0 1/3 -1/3 0 1/3 FB: 0 1 0 0 1 0 0 1
Color sequence: 01001001001
14
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #2


Consider a 2D image/primitive
Goals: Spread errors out in x and y pixels Nearby gets more error than far away Floyd-Steinberg Error Distribution Method
Let the current pixel be Distribute error as follows:

15
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #2


Let be the shade of pixel To draw we round pixel to nearest shade and set Then, diffuse the errors throughout surrounding pixels, e.g.
S[x + 1][y] += (7/16) err S[x - 1][y - 1] += (3/16) err S[x][y - 1] += (5/16) err S[x + 1][y - 1] += (1/16) err

16
Pics/Math courtesy of Dave Mount @ UMD-CP

Halftone Approximation: Error Diffusion Example #2

17
Pics courtesy of Dimitri Gusev @ Indiana

5.2 Dithering
Another technique for digital halftoning is dithering. Dithering can be accomplished by thresholding the image against a dither matrix. The first two dither matrices, rescaled for application to 8-bit images, are

The elements of a dither matrix are thresholds. The matrix is laid like a tile over the entire image and each pixel value is compared with the corresponding threshold from the matrix. The pixel becomes white if its value exceeds the threshold or black otherwise. This approach produces an output image with the same dimensions as the input image, but with less detail visible.

Algorithm to halftone an image using a dither matrix. for all x & y do if f(x,y) > m(x,y) then g(x,y) = white else g(x,y) = black end if End for

Fig.5.3. Halftoning with dither matrices. (a) Input image. (b) Halftoned image using D1. (c) Halftoned image using D2

You might also like