Halftoning - PowerPoint PPT Presentation

1 / 85
About This Presentation
Title:

Halftoning

Description:

Restricted Mosaic. Simulated tiles. tile color = underlying image. many colors possible ... Restricted-color Mosaic. Continuous color. 27 tile colors. Better ... – PowerPoint PPT presentation

Number of Views:83
Avg rating:3.0/5.0
Slides: 86
Provided by: csU55
Category:
Tags: halftoning

less

Transcript and Presenter's Notes

Title: Halftoning


1
Halftoning
  • Halftoning problem
  • Full-color image
  • Few-color display device
  • usually 2 colors black and white
  • input full color image
  • output reduced-color image
  • Ancient Solutions!

2
Fixed Threshold
  • Given
  • in (x,y) input image
  • S set of output colors, usually S0,1
  • out (x,y) c?S, minimum c - in(x,y)
  • out(x,y) 0, if in(x,y) lt 1/2
  • 1, if gt 1/2

3
Random Threshold
  • Given
  • in (x,y) input image
  • S set of output colors, usually S0,1
  • out (x,y) pick r random (0 to 1)
  • out(x,y) 0, if in(x,y) lt r
  • 1, if gt r

4
Comparison
  • Fixed Threshold
  • sharp edges preserved
  • no gray information
  • Random Threshold
  • noisy edges
  • more gray information

5
Color Reduction Problem
  • Print continuous-tone images
  • image colors gtgt device colors
  • eg laser printer colors 2

Continuous tone
Fixed threshold
Random threshold
6
Fixed Threshold
7
Random Threshold
8
1695 Mezzotint
9
Basic Principle
  • Trade off
  • color detail vs spatial detail
  • Why?
  • eye integrates nearby pixels
  • sees gray

10
Halftoning
  • Two basic types
  • Ordered dither
  • Bayer, Clustered-dot
  • matrices of thresholds
  • Error diffusion
  • Floyd-Steinberg, Stucki
  • process pixel, adjust neighbors

11
Halftoning
original
ordered
clustered
Error diffusion
12
Ordered Dither
  • Many different thresholds
  • Threshold depends on (x y)
  • Random Threshold
  • image looks grainy
  • Repeated Thresholds
  • visible repeated pattern

13
Ordered Dither
  • Group pixels into blocks
  • eg 2x2 block
  • 5 gray levels
  • Algorithm
  • i x mod n, j y mod ne int( in(x,y)
    n2)out(x,y) 0 if e gt M(i,j)
    1 if e lt M(i,j)

3
1
0
2
14
Which Matrix?
  • Bad matrices
  • linear artifacts
  • consecutive entries are nearby in matrix
  • Good matrices
  • consecutive entries are far apart

0
1
2
3
4
5
6
7
8
0
3
6
1
4
7
2
5
8
15
Bayers Matrices
  • Bayer 1976
  • (2n x 2n)
  • Defined recursively

3
1
2x2
0
2
15
7
13
5
3
11
1
9
4x4
12
4
14
6
0
8
2
10
16
Ordered Dither Example
input
output
detail
17
Dispersed-dot Ordered Dither
18
Dispersed-dot synthetic image
19
1844 Jacquard Loom Weaving
20
Clustered-Dot Dither
  • Commercial printing
  • cant print tiny isolated dots
  • use bigger dots
  • less spatial resolution
  • spiral threshold pattern

14
8
9
15
7
1
2
10
4x4
6
0
3
11
13
5
4
12
21
Newspaper Image
22
Hand-made Stippling
23
Color Clustered Dot
  • Square grid of dots very evident
  • 45-degree grid less evident
  • 4 inks Cyan, Magenta, Yellow, Black
  • overlaps moire patterns
  • rotate colored inks
  • less moires

24
Four-Color Printing
yellow
cyan
magenta
black
25
Printed Result
26
Space-Filling Curve
  • Hilbert Curve
  • consecutive locations nearby
  • like clustered-dot
  • dots not round

27
Space-Filling Curve
  • 4x4 matrix
  • 17 gray levels

28
Space-Filling Curve
Test Gray Ramps
29
Halftoning
  • Two basic types
  • Ordered dither
  • Bayer, Clustered-dot
  • matrices of thresholds
  • Error diffusion
  • Floyd-Steinberg, Stucki
  • process pixel, adjust neighbors

30
Error Diffusion
  • Problem fixed threshold 0 or 1
  • info lost error
  • overall tone of image incorrect
  • Solution use the error
  • give it to pixels neighbor

31
Floyd-Steinberg
processed
  • Algorithm (? ? ? ?1)
  • out(x,y) closest to in(x,y)
  • e in(x,y) - out(x,y)
  • in(x1, y) ? e
  • in(x-1,y1) ? e
  • in(x, y1) ? e
  • in(x1,y1) ? e


?
?
?
?
? 7/16? 3/16? 5/16? 1/16
32
Error Diffusion
33
Error Diffusion Synthetic image
34
Error Diffusion
  • Problems
  • worms advancing error front
  • blurring
  • Solutions
  • bidirectional processing
  • pre-filtering
  • wider kernel (spread error further)
  • Stucki

35
Random-Dot Error Diffusion
  • Problem
  • Color dot positions known
  • Assign colors
  • Challenge
  • dots not on a grid
  • Approach
  • error diffusion on graph

36
The Approach (2)
  • Random-dot F-S
  • nearest dot neighbors
  • in what order?
  • Floyd-Steinberg (F-S)
  • pixel neighbors
  • scanline order
  • Dot-processing orders investigated
  • get nearest-neighbor graph, traverse
  • depth-first
  • breadth first
  • error-driven (choose from frontier dots)
  • hybrids

37
Original Dots
38
Points (dot centers)
39
Dots and Neighbors (Delaunay Triangulation)
40
Pixel Graphs
(Pixels have neighbors too)
used by F-S
4-neighbors
diagonal neighbors
8-neighbors
41
The Algorithm
  • Visit Dots in some order
  • for each dot
  • set to closest color in set
  • (color changed ? error)
  • add error to neighbors

42
Visit dots in What order?
  • dots nodes in graph
  • visit dots traverse graph
  • depth-first graph traversal?
  • breadth-first?
  • other?

43
Depth-first graph traversal
  • Stack stores advancing front
  • push node on stack
  • while (stack not empty) node ? top of
    stack process node (color it) for each
    neighbor of node push neighbor on
    stack

44
Breadth-first graph traversal
  • Queue stores advancing front
  • push node on queue
  • while (queue not empty) node lt head of
    queue process node for each neighbor of
    node append neighbor on queue

45
Error-driven traversal
  • Front set of candidate dots
  • add node to front
  • while (front not empty) choose node from
    front (min, max, or median error)
    process node for each neighbor of node
    add neighbor to front

46
Gray Ramp Test (8-neighbor graph)
Gray ramp
Depth-first(DFS)
Breadth-first(BFS)
25 BFS 75 DFS
47
Use Hybrid Traversal
  • Error-driven traversal looks horrible!
  • too ugly to show
  • Breadth-first and Depth-first show artifacts
  • Hybrid
  • queue of pixels, random variable x (0 ? x ?
    1)
  • if (x ? 1/4) get pixel from head of queue
  • if (x gt 1/4) get pixel from tail of queue

48
Pointillism simulation
  • Restricted set of colors
  • Dots are paint strokes
  • Assume dot positions are known

49
Seurats Pointillism
Original
Simulation
50
Luces Pointillism
Original
Simulation
51
Color Stippling
52
Application Color Printing
  • 4-color offset printing
  • dots overlap
  • loss of saturation
  • random-dot halftoning color stippling
  • dots dont overlap
  • brighter colors

53
Comparison
Standard 4-color printing
Error diffusion on adjacency graph
54
Comparison
Sharper, more saturated
4-color printing
55
Restricted Mosaic
  • Simulated tiles
  • tile color underlying image
  • many colors possible
  • Actual tiles
  • limited color choice
  • must use halftone
  • Dots are square!
  • use area voronoi diagram to get graph

56
Restricted-color Mosaic
Continuous color
27 tile colors
57
Better-chosen colors
2000 tile colors
8 tile colors
58
Graph-Order Dither
  • Generalizes Bayers Dither
  • Pixels in arbitrary positions
  • Problem
  • Given n points in 2D,find visitation order,with
    consecutive points far apart

59
Dispersed-Dot Dither
  • Bayer (1976)
  • Threshold Matrix (2n x 2n)
  • replicated across image
  • 4 x 4 matrix
  • 0 8 2 10
  • 12 4 14 6
  • 3 11 1 9
  • 15 7 13 5

60
Consecutive Separation
  • 0 8 2 10
  • 12 4 14 6
  • 3 11 1 9
  • 15 7 13 5
  • Consecutive entries (eg 12, 13) far apart
  • Yields intermediate tones (grays)
  • Avoids clusters

61
The Problem
  • Matrix Dots on square grid
  • Random Dots no grid
  • Problem Given dots in 2D, order them so
    that consecutive points are far apart.

62
Algorithm
  • Color nodes
  • Pick one color
  • Color only those nodes
  • Repeat

63
A Graph
node
node
arc
64
Colored Graph
arcs join adjacent nodes every two
adjacent nodes get different colors
65
Single-Color Separation
red nodes far apart
66
Colored Graph
67
Single-Color Separation
green nodes far apart
68
Colored Graph
69
Single-Color Separation
blue nodes too
70
Colored Graph
71
Single-Color Separation
and yellow too
72
Repeat
pick one color
73
Repeat
build neighbor graph
74
Repeat
color again yellow nodes even farther apart than
before
75
Repeat Recursively
22
111
1 yellow 2 blue 3 green 4 red
322
211
13
31
42
12
23
33
212
41
321
112
76
Sort Labels
22
111
lexicographic order 1 111 2 112 3
12 4 13 5 211 6 212 7 22 8
23 9 31 10 321 11 322 12 33 13 41 14
42
322
211
13
31
42
12
23
33
212
41
321
112
77
Consecutive Separation
7
1
lexicographic order 1 111 2 112 3
12 4 13 5 211 6 212 7 22 8
23 9 31 10 321 11 322 12 33 13 41 14
42
11
5
4
9
14
3
8
12
6
13
10
2
78
Algorithm
  • label(S) //
    s set of points construct G(S)
    // G(S) neighbor graph color
    vertices with k colors for j 1 to k
    // for each color Sj
    points with color j append j to all
    labels in Sj label (Sj)
  • sort all labels in lexicographic order

79
Properties
  • consecutive points far apart
  • many orderings of same points
  • each graph has many colorings
  • points need not be on grid

80
Applications
  • Dithering without repetitive artifacts
  • use many different dither matrices

81
Applications
  • Artistic Screening
  • usual goal hide artifacts
  • repeated matrix repetitive artifact
  • artistic goal artifact art
  • repeated matrix decorative pattern

82
input
dither matrix
detail
83
input
26 dither matrices
detail
84
Application
  • Dither with shapes
  • collection of shapes
  • can get neighbor graph
  • hierarchical coloring

85
input
shapes
Write a Comment
User Comments (0)
About PowerShow.com