Achromatic Light - gray levels

 

Achromatic light:

 


Selecting intensity

1. Linear scale

Ii =i/(n-1), i=0,1,...n-1

eg. n=16

Ii=0, 0.07, 0.13, 0.2,..., 0.93,1

 

 

2. Logarithmic scale

Weber-Fechner Law

The visual perception of an arithmetical progression depends upon a physical geometric progression 

I0=I0,  I1=r*I0,  I2=r*I1=r2*I0, ... . In-1 = rn-1*I0=1

Ii = (I0)(n-1-i)/(n-1)  i=0,1,...n-1

Dynamic range of a device: ratio of maximum to minimum intensities, i.e., 1/I0

Typical on CRT anywhere from 40:1 to 200:1 =>

                            I0 = 0.005 - 0.025 for most monitors

eg. n=16 I0=0.01

    Ii=0.010, 0.014, 0.018,..., 0.72,1

       

       

 

3. Gamma correction

We must consider the nonlinearities CRT monitors

Ii - intensity of pixel

Vi - value specified for the pixel

Ui = K1*Vi

Ni = K1*Ui

Ii = K1*Nigamma

    Ii =K*Vigamma

Vi = round((Ii/K)1/gamma)

K - depends on amount of bit planes in frame buffer

gamma = 2.2 ...2.5 for most CRT

Vi = round((2n-1)*(exp(lnIi/gamma)))

       

 


Mach Bands

the intensity at the vicinities of the edges is overestimated for light values and underestimated for dark values.

 

 


Halftoning and Dithering

 

1. Halftoning 

Each small resolution unit is imprinted with a circle of blank ink whose area is proportional to the blackness (1-I) of the area in the original photograph

The pattern makes a 45deg angle with the vertical for black, 90deg for yellow, 75deg for magenta and 105 for cyan.

Traditional printing:

Digital printing:

 

 

2. Dithering

 

The Average Dithering

The Average Dithering is a basic two-level algorithm for halftone image. It consists in choosing a certain constant gray level, in  particular the average value of image pixels, and using it as a global threshold in deciding whether a pixel should be quantized to 0 or to 1. All pixels whose intensity level lies above the average value (the threshold) are quantized to 1; all others get a value of 0.

This method is simple to implement but it has a disadvantage: quantization contouring is quite perceptible

original image

original image after the application of average dithering

 

The Random Dithering

This is the bubble sort of dithering algorithms.  It is not really acceptable as a production method, but it is very simple to describe and implement.  For each value in the image, simply generate a random number 1..256; if it is greater than the image value at that point, plot the point white, otherwise plot it black. 

original image

original image after the application of random dithering

 

The Ordered Dithering

a) Image Array is smaller than the display array

- multiply displays pixels are used for one image pixel

n x n - k-level pixels provide n2 *(k-1)+1 intensities

 A 4x4 dither matrix set of 17 patterns, used to interpolate between black and white. The size of the patterns has been exaggerated (scaled by ~3).

 

Dither matrix:

D2= 0 2
3 1
D3= 6 8 4
1 0 3
5 2 7

Larger dither matrices can be found by using recurrence relation:

D2n= 4*Dn 4*Dn+2*Un
4*Dn+3*Un 4*Dn+1*Un

 where Un - matrix nxn 1s

a) k=2

To display an intensity I we turn on all pixels, whose values are less than I.

b) k>2

I(image) is in range <0,n2 *(k-1)>

col = I(image) div n2

re = I(image) mod n2

nxn device pixels are painted using col and col+1 colors due to dither matrix Dn and re value.

 

b). Image Array is the same size as the display array

1 pixel in the image array controls 1 pixel in the display array

   Ii = GetPixel(x,y);
   // Ii is in range <0,n2 *(k-1)>

   col = Ii div n2
   re  = Ii mod n2
   
   i = x mod n
   j = y mod n

   if re >Dn[i,j] 
     col++

   PutPixel(x,y,col);	

 

original image

original image after the application of ordered dithering

Image with 256 gray levels:

Image with 2 colors  (B&W) after Ordered Dithering processing:

 

Error diffusion dithering

Error (i.e., the difference between the exact pixel value and the approximated value) is added to the values of the image-array pixels to the right of and below the pixel.

 

Filters:

1. Floyd and Steinberg Filter:

0

0

0

0

0

7/16

3/16

5/16

1/16

2. Burkes Filter

0 0 0 0 0
0 0 0 8/32 4/32
2/32 4/32 8/32 4/32 2/32

3.Stucky Filter

0 0 0 0 0
0 0 0 0 0
0 0 0 8/42 4/42
2/42 4/42 8/42 4/42 2/42
1/42 2/42 4/42 2/42 1/42

 

original image

original image after the application of Floyd-Steinberg dithering

 

 

Ordered Dithering vs. Error Diffusion

256 Gray levels:
Ordered Dithering

 (2 levels)

Error Diffusion

(2 levels)