Dithering

  1. Reduce the number of colors used in an image
  2. Decrease the size of image file
  3. Use a limited colors to show the image on a device

Three type of input:

Matrix

Such as:

2x2 Matrix

4x4 Martix

0 2
3 1

0    8   2  10
12  4  14  6
3   11  1   9
15  7  13  5

 

Level

Lower level will use lesser color to represent the image
Higher level will use more color to represent the image

    1. L1 ~21 = remap image pixels in 0..255 into 0..1 range (256/2)
    2. L2 ~22 = remap image pixels in 0..255 into 0..3 range (256/4)
    3. L3 ~23 = remap image pixels in 0..255 into 0..7 range (256/8)
    4. L4 ~24 = remap image pixels in 0..255 into 0..15 range (256/16)
    5. L5 ~25 = remap image pixels in 0..255 into 0..31 range (256/32)
    6. L6 ~26 = remap image pixels in 0..255 into 0..63 range (256/64)
    7. L7 ~27 = remap image pixels in 0..255 into 0..127 range (256/128)
    8. L8 ~28 = remap image pixels in 0..255 into 0..255 range (256/256)

Color Dither 

Yes = color image

-Calculate each pixel for the image and process dithering

No = grey image

-Change the image to grey image then process dithering