The Batik Trick a Physically Plausible Simulation of Traditional Batik Painting using Distance Transforms, Distance Transforms, and Distance Transforms by Brian Wyvill and Kees van Overveld contents 1. The Art of Batik Painting 2. The Visual Effects and their Causes 3. Distance Transforms 4. A Batik Simulator 5. Results, Conclusions and Summary 1.The Art of Batik Painting Batik (American: ba-teek’; Correct: bah’-tik) •origins unknown; 2000 years old; Middle-east, India or Central Asia? •most prevalent: Indonesian island of Java; since 14th or 15th century • http://www.story-of-batik.com/html/history_of_batik.html 1.The Art of Batik Painting 1.The Art of Batik Painting the wax-gorithm: while (not ready){ dye entire cloth with color C; for(p in uncovered region) p.color *= C; wash off color on wax-covered areas (if any); cover part of exposed region with wax; if(expensive || just for fun) remove wax from some regions; } correct mistakes or add painted details; sell; // you should be rich now !!! 1.The Art of Batik Painting example 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates: 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates: cracks occur in time-order ... because crack-propagation is a causal process: cracks run until they encounter another (earlier) crack or the bound of the wax instead of all-at-once so there are few crack crossings but most Tjunctions 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates: cracks occur in time-order cracks often end in maximally concave regions of wax borders ..instead of... ...because it is energetically cheap to have shorter cracks 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates: cracks occur in time-order cracks often end in maximally concave regions of wax borders cracks erode, so older cracks result in wider dye traces than younger cracks 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates: cracks occur in time-order cracks often end in maximally concave regions of wax borders cracks erode, so older cracks result in wider dye traces than younger cracks junction regions are fragile, so wax breaks off, leaving widened ‘younger’ crack ends 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates cracks occur in time-order cracks often end in maximally concave regions of wax borders cracks erode, so older cracks result in wider dye traces than younger cracks junction regions are fragile, so wax breaks off, leaving widened ‘younger’ crack ends ...this will be achieved by an appropriate noise function 2.The Visual Effects and their Cause (the phenomenology of dye absorption and wax cracking) non-homogenous cloth absorption rates cracks occur in time-order cracks often end in maximally concave regions of wax borders cracks erode, so older cracks result in wider dye traces than younger cracks junction regions are fragile, so wax breaks off, leaving widened ‘younger’ crack ends ...whereas various Distance Transforms will be used for these 3.Distance Transforms (Jack-of-all-trades in image processing) 3.Distance Transforms (Jack-of-all-trades in image processing) formal definition: for a set S, and a metric | , |: S S and a subset VS, we define s, sS: D(s)=MIN(v:v V:|s-v|) 3.Distance Transforms (examples) in geometry: for small distance D: L1 -metric arb. shape V for large distance D: L2 -metric L -metric small D: V’s border small D: V’s border small D: V’s border large D: diamond large D: circle large D: square 3.Distance Transforms (observations) •distance transform models decreasing influence at larger D: shape details are lost (Huygens’ principle) •shape of (D=const)-contour dominates for large D •distance transform is related to • Minkowsky sum • Voronoi diagram • low-pass filtering & multi-scale • implicit surfaces • Dijsktra’s shortest path (discrete S) •most preferred metric: L2 (independent of coordinate system) •brute force calculation requires O(|S||V|) calculations •approximations require O(n |S|) calculations 3.Distance Transforms (fast approximation) a two-pass algorithm for the Distance Transform: for(pixel p in V) D(p)=0; for(pixel p in S\V) D(p)=infinity; for(pixel p: scan from top left to bottom right){ for(pixel n in upper left half Neighborhood(p)) if(D(n)+|n-p|>D(p))D(p)=D(n)+|n-p|; } for(pixel p: scan from bottom right to top left){ for(pixel n in lower right half Neighborhood(p)) if(D(n)+|n-p|>D(p))D(p)=D(n)+|n-p|; } (optionally, smooth D(p) with a suitable relaxation) 3.Distance Transforms (fast approximation) 0 0 0 0 0 3.Distance Transforms (fast approximation) 0 0 0 0 0 3.Distance Transforms (fast approximation) 0 0 0 0 0 3.Distance Transforms (fast approximation) 0 1 0 0 0 0 3.Distance Transforms (fast approximation) 0 1 0 0 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 0 0 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 0 0 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 2.41 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 2.41 2 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 2.41 2 2 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 2.41 2 2 2.41 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 1.41 1 1 1.41 2.41 2.82 2.41 2 2 2.41 2.82 next we revert the scanning direction 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.42 0 0 1 2 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 3.41 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 3.82 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 3.41 3.82 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 3 3.41 3.82 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2 3 3.41 3.82 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2.41 2 3 3.41 3.82 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (fast approximation) 2.82 2.41 2 3 3.41 3.82 4.23 2.41 1.41 1 2 2.41 2.82 3.82 2 1 0 1 1.41 2.41 2.82 2 1 0 0 1 1.41 2.41 3 2 1 0 0 1 2 3.41 2.41 1.41 1 1 1.41 2.41 3.82 2.82 2.41 2 2 2.41 2.82 3.Distance Transforms (related algorithms) •the distance transform can be turned into an identity+distance transform (IDT) by also keeping track of the identity of the closest object Vi: this is a discrete approximation to the Voronoi diagram with arbitrary initial objects. remember: for(pixel p in V ) D(p)=0; for(pixel p in S\ V ) D(p)=infinity; for(pixel p: scan from top left to bottom right){ for(pixel n in upper left half Neighborhood(p)) if(D(n)+|n-p|>D(p)) D(p)=D(n)+|n-p|; } (and similar for other half) 3.Distance Transforms (related algorithms) •the distance transform can be turned into an identity+distance transform (IDT) by also keeping track of the identity of the closest object Vi: this is a discrete approximation to the Voronoi diagram with arbitrary initial objects. remember: for(pixel p in Vi) {D(p)=0;Id(p)=Vi; } for(pixel p in S\{Vi}) {D(p)=infinity; Id(p)= ‘none’;} for(pixel p: scan from top left to bottom right){ for(pixel n in upper left half Neighborhood(p)) if(D(n)+|n-p|>D(p)) {D(p)=D(n)+|n-p|; Id(p) = Id(n); } } (and similar for other half) 3.Distance Transforms (related algorithms) •the distance transform can be turned into an identity+distance transform (IDT) by also keeping track of the identity of the closest object Vi: this is a discrete approximation to the Voronoi diagram with arbitrary initial objects. •after D(s) is computed, it tells the shortest distance to the border of V. D(s) allows local updating in case of local modifications of V. •larger neighborhoods give better approximation to circular (D(s)=const)contours 3 x 3, 4-connected: square; 3 x 3, 8-connected: 8-gon, 5 x 5, 24-connected: 16-gon, 7 x 7, 48-connected: 32-gon, etc. 4.A Batik Simulator (architecture) 4.A Batik Simulator (architecture) •the Batik process simulation consists of two phases: •generating cracks •applying a next dye bath, taking the recent cracks into account 4.A Batik Simulator (crack generation) •crack initialization •crack propagation •crack tuning 4.A Batik Simulator (crack generation: crack initialization) V = current wax distribution; generate D(s); while(not enough cracks){ pick random point p V; // The chance to pick a cell is proportional to the area // of the cell. This results in uniform average cell areas. while (n Neighbors(p), D(n)>D(p))p=n; // D(p) is local maximum of the Distance Transform (DT) find direction d of steepest descent; propagateCrack(p,d,-d); // Every crack ends at the border of the cell it started in. // Rationale: cracks start far from border where stress // is high update DT (only in the environment of recent crack) } 4.A Batik Simulator (crack generation: crack propagation) propagateCrack(p,d[0],d[1]){ // have two halves of the crack run simultaneously p[0]=p[1]=p; while(not ready){ for(j=0;j<2;j++)if(p[j] in wax (=not on a crack or off wax)){ step p[j] in direction d[j]; estimate d[j] based on local distance gradient; // rationale: this ensures shortest way to the border of the cell, // therefore to maximally curved local concavities (if any) perturb d[j] with IIR-filtered noise } } } 4.A Batik Simulator (crack generation: crack propagation; cont.-d) p[0] the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) the pixels labeled with black squares are labeled as ‘on a crack’; their distance values D(s) are sub-pixel accurate; the formed crack is the red polyline with subpixel coordinates; the blue squares indicate pixels used for computing D(s) and the next positions of p[j] 4.A Batik Simulator (crack generation: crack propagation; cont.-d) ...etcetera until we reach a pixel that is already on a crack or off the wax 4.A Batik Simulator (crack generation: crack tuning) we account for two additional effects: •the age of a crack for age-dependent width of the dye track •widening the junction between a crack and an older crack 4.A Batik Simulator (crack generation: crack tuning; age administration) During crack propagation, store ‘age of the crack’(=inverse of crack counter) as an identification tag in all ‘crack’ pixels. After all cracks are generated, use identity+distance transform to attribute, to each pixel p, the age of the crack C to which p is closest, together with the distance to C. prior to IDT: pixels are labeled as ‘wax’ or ‘crack’; only ‘crack’-pixels know their age after IDT: all pixels have an ‘age’ label set. ‘wax’-pixels know both the distance to the closest crack and the age of that crack. 4.A Batik Simulator (crack generation: crack tuning; age administration) And now it’s time for some serendipity: the wedge-shaped generalized Voronoi shapes look just like typical batik-type irregularities in dye-absorption near the wax cracks! prior to IDT: pixels are labeled as ‘wax’ or ‘crack’; only ‘crack’-pixels know their age after IDT: all pixels have an ‘age’ label set. ‘wax’-pixels know both the distance to the closest crack and the age of that crack. 4.A Batik Simulator (crack generation: crack tuning; junction administration) D(s) tells how far s lies from the nearest junction with the border or the nearest older crack: there, D( )=0. During crack propagation, label crack pixels p with info about their distance to the nearest junction (‘d2j’) iff D(p)<THRESHOLD. Similar as with ‘age’, distribute the values of d2j also to non’crack’-pixels, using a (modified) distance transform. However, this time decrease rather than increase the distance attribute. THRESHOLD-D(p) D(p) d2j=Max(0,THRESHOLD-D(p)) THRESHOLD Border of the cell: D( )=0 Distance along the crack 4.A Batik Simulator (crack generation: crack tuning; junction administration) D(s) tells how far s lies from the nearest junction with the border or the nearest older crack: there, D( )=0. During crack propagation, label crack pixels p with info about their distance to the nearest junction (‘d2j’) iff D(p)<THRESHOLD. Similar as with ‘age’, distribute the values of d2j also to non’crack’-pixels, using a (modified) distance transform. However, this time decrease rather than increase the distance attribute. prior to modified distance transform: only ‘crack’-pixels have a valid d2j-attribute junction after modified distance transform: all pixels have a valid d2j-attribute which is propagated outwards and decreased with distance to the crack. 4.A Batik Simulator (summary of crack generation) •as we saw, the Batik process simulation consists of two phases: •generating cracks •crack initiate •crack propagate •crack tuning •age administration •junction administration •applying a next dye bath, taking the recent cracks into account 4.A Batik Simulator (dye application; color model) Dyes may be modeled as color filters: r=100 g=100 b=100 transmit: r *=0.9; g*=0.9; b*=0.4 r=90 g=90 b=40 transmit: r *=1.0; g*=1.0; b*=0.25 reflect: r *=0.9; g*=0.9; b*=0.9 r=0.72 g=0.72 b=0.008 dye 2: yellow r=0.81 g=0.81 b=0.02 dye 1: dark orange r=90 r=0.81 g=90 g=0.81 b=10 b=0.09 substrate So we model color filtering by means of component-wise multiplication of dye colors 4.A Batik Simulator (dye application; algorithm) if(p off wax){ col = dyeColor; } else { d2c = distanceToNearestCrack; // using D(p) aof = ageOfNearestCreack; // using age(p) d2j = distanceToNearestJunction // using d2j(p) amp = computeIntensityOfColorToBeApplied (d2c,aof,d2j); // decreases with d2c; increases with aof; // increases with d2j; col = dyeColor * clamp(amp, 0%, 100%) } modulate col with a bandwith filtered noise function; apply to pixel p using multiplicative color model; 4.A Batik Simulator (external controls) The R,G,B channels in the input images constitute process control parameters: •red: R(x,y)=0: no wax; R(x,y)>0: thickness of the wax (crack width is multiplied with R(x,y)) •green: in the crack initialization, random candidates are taken iff rand(0...1) > G(x,y). So expected cell size is proportional to G(x,y) •blue: during crack propagation, the path direction is randomly perturbed with an IIR-filtered random sequence. The random amplitude is B(x,y) 5.Summary and Conclusions 1. The batik simulator gives convincing batik-type modification of flatcolored, segmented images 2. The various mechanisms in the batik process can be modeled in terms of geometric operations and re-entrant image processing operations 3. All required algorithms can be straightforwardly derived from the distance transform 4. An open question remains as to the methodological soundness of distance transform-based crack formation compared to finite elements- enter the issue of incommensurable sets of assumptions! based techniques: 5.Results and Conclusions the effect of widening cracks with age 5.Results and Conclusions (cont) modulating crack width: the red channel 5.Results and Conclusions (cont) modulating crack density: the green channel 5.Results and Conclusions (cont) modulating randomness: the blue channel 5.Results and Conclusions (cont) the process of building a piece of batik 5.Results and Conclusions (cont) Questions?