color half toning half toning digital half toning half
play

Color Half Toning Half Toning Digital Half Toning Half toning and - PDF document

Color Half Toning Half Toning Digital Half Toning Half toning and Colors Half Toning Half Toning Emulating 5 different levels (0) (1) (2) (3) (4) (0) (1) (2) (3) (4) (7) (8) (9) (5) (6) (0) (1) (2) (3) 10 levels (0) (1)


  1. Color Half Toning Half Toning Digital Half Toning Half toning and Colors Half Toning Half Toning Emulating 5 different levels (0) (1) (2) (3) (4) (0) (1) (2) (3) (4) (7) (8) (9) (5) (6) (0) (1) (2) (3) 10 levels (0) (1) (2) (3) (4) 1

  2. Original Dithering Thresholding Dithering and Halftoning Trade spatial for intensity resolution Assume we want to quantize a gray-level (works well for printing where dot printing is very image to a binary colormap. high) • Thresholding. • Random dither; Robert’s algorithm Map the upper half of the gray-level scale to • Ordered dither white, and the lower half to black – a simple • Error diffusion threshold operation, preformed Your eye will average over an area independently at each pixel. - Spatial Integration 2

  3. Robert’s Algorithm Thresholding Simple threshold. • First add noise n = 0.5 n = 0.7 Original image. � ( , ) ( ( , ) ( , )) v x y trunc K v x y noise x y � � � • Then quantize 0 � noise 1 � i r + 1 1 Quantized to 1 Quantized to 0 r 0 x Moves errors to higher spatial frequencies. v ( x , y ) trunc ( � v ( x , y ) n ) Errors are low spatial frequencies. � � -> eye averages over an area. The trouble with noise Robert’s Algorithm • Difficult to compute quickly. • Not reproducible. • Pre-compute pseudo-random function and store in table. Pink Blue • Small tiled patterns sufficient Dithering Each pixel produces a quatization error The quality of the result may be improved by adjusting the threshold locally, so that adjacent pixels in small areas are quantized with different thresholds. This reduces the average local quantization error. Matrices of these threshold are called dither matrices. 3

  4. Ordered Dithering Comparison • Trade off spatial resolution for intensity resolution. • Use dither patterns. • Can be represented as a matrix. The dithering matrix (3x3) Other possibilities 3 7 5 6 1 2 9 4 8 For all Xpixels For all Ypixels v = approximate(x,y) i = x mod 3 j = y mod 3 if v >= M[i,j] then Set_Pixel(x,y, BLACK) else Set_Pixel(x,y, WHITE) Comparison. Dithering 3 7 5 3 7 5 6 1 2 Dithering mask 6 1 2 9 4 8 9 4 8 3 7 7 5 5 8 1 6 2 4 5 3 2 2 1 3 Image 6 6 8 1 2 7 2 2 5 4 3 2 3 2 2 3 9 9 4 4 8 8 4 3 7 5 2 6 4 4 8 4 3 3 7 5 8 9 7 7 2 2 1 3 2 0 0 0 6 6 9 1 2 2 9 7 4 3 2 2 4 Binary image 0 1 1 9 9 4 4 8 8 8 8 4 4 8 4 4 0 1 0 4

  5. Floyd-Steinberg Error Diffusion 1D Error Diffusion With this method, the average quatization error is reduced by propagating the error from each pixel to some of its neighbors in the scan order. 1 0 1 1D Error Diffusion 1D Error Diffusion 1 1 0 0 1D Error Diffusion 1D Error Diffusion 1 1 0 0 1 0 5

  6. 1D Error Diffusion 1D Error Diffusion 1 1 0 0 1 0 1 1D Error Diffusion 1D Error Diffusion 1 1 0 0 Floyd-Steinberg Error Diffusion Dither vs. Floyd-Steinberg With this method, the average quatization error is reduced by propagating the error from each pixel to some of its neighbors in the scan order. e e -3e/8 -3e/8 -e/4 -e/4 -3e/8 -3e/8 Note that the error propagation weights must sum to one 6

  7. Original Picture Examples – Continue Error diffusion result Dithering result Error Diffusion Dithering Dithering: Error Diffusion: Note that each Note that the square ring is of error is different distributed brightness across the layers 7

  8. Dithering Examples – Continue Original: Error Diffusion Error Diffusion Set AccErr[] to zero; For each pixel in the image scanning from left to right: value= Pixel_value(x,y) + AccErr[x,y]; if (value > WHITE/2) { Set_pixel(x,y, WHITE); Error = value - WHITE; } else { Set_pixel(x,y, BLACK); Error = value - BLACK; } if scanning from left to right { AccErr[x+1, y] += 3/8 * Error; AccErr[x, y+1] += 3/8 * Error; AccErr[x+1,y+1] += 2/8 * Error; } ���������������������� ���������������������� • ������������� ������������� ����� 8

  9. ���������������������� ���������������������� ������������� ������������� ����� ����� ���������������������� ���������������������� ������������� ����� ����� ����� Original Image ����������������� 9

  10. Bayer’s Ordered Dithering Threshholding Median Cut (4 levels) Error Diffusion Median Cut (8 levels) 10

Recommend


More recommend