기본 정보
- 저자
- DOI
- 10.1002/cav.2200
- 저널
- Computer Animation and Virtual Worlds
- 발행년도
- 2023
- 발행기관
- Wiley
- 피인용수
- 2
- 라이선스
- cc-by-nc
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1002/cav.2200
- 토픽
- Color Science and Applications
- OpenAlex ID
- W4385408110
평가 내용
- 관련도
- 사업분야
- 모빌리티 소재 · (2) 샤무드(인공피혁)
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '모빌리티 소재 > 샤무드(인공피혁)' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
본문 45,786자
본문 펼치기
섹션 본문 74문단 · 43,825자
(제목 없음)
1On-site workshops provide an opportunity to learn the craftsmanship, but the first hurdle is often high.Online handcraft experiences can be a solution to this first hurdle by providing preliminary craft experience from anywhere on the internet.In collaboration with a traditional craftsman, this motivated us to develop an online simulator for a thin-brush dyeing, called yuzen, one of the Japanese traditional handcrafts innovated in the 17th century.The goal of this simulator is providing easy-going experience, that is, it can be materially unrealistic but mimicking visual appearance.The simulator incorporates various characteristics of yuzen, by which the developed 2D fluid simulation algorithm reduces its computational burden.The yuzen dyeing algorithm is similar to an existing ink-wash painting algorithm, but the present work provides (1) theoretical justification for the algorithm and parameter choices, (2) implementing yuzen dyeing-specific characteristics, and (3a) a physical experiment to examine qualitative resemblance, and (3b) to identify unknown physical parameters for further reality in future development.
Motivation
2Making a traditional craft in a visited country is a quite memorable experience.Telling the value of the craftsmanship is important for both international/domestic tourism and sustainable cultural transmission.Making a thing tells us more than just seeing it-especially about the skill or craftsmanship of the traditional craftsmen.Knowing the craftsmanship, or how sophisticated it is, is knowing the value of the handcrafted object.You may wonder how and why an object is so expensive if you just see its price, without knowing how it has been handcrafted piece by piece over a long period of time.On-site craft workshops provide an opportunity to deepen one's knowledge and learn traditional handcraft.However, not all handcrafted products are suitable for this activity, due, for example, to multi-stage manufacturing processes that require days or months before the product is finished.Although culture and handcraft experiences are popular with tourists, this is not compatible with the most common form of tourism, that is, staying in a place for only a few days.The lack of a way to experience artifact-making without visiting the site is another limitation to the appeal of on-site workshops, because the decision to visit a country and participate in a workshop requires a pre-existing interest in the handicraft activity.Handcraft experiences should be used to attract more attention and promote tourism for the purpose of attending on-site workshops, that is, real handcraft experience.In collaboration with a traditional craftsman, this motivated us to develop an online simulator for a thin-brush dyeing, called Yuzen.
3Yuzen is a type of traditional Japanese craftsmanship, a technique of dyeing cloth with patterns.Figure 1 contains a real example of yuzen, as well as simulation results.Among many dyeing methods such as early tie dyeing and later stencil dyeing, yuzen dyeing is used to produce pictorial patterns resulting from the innovative use of a thin brush and masking glue, which prevent colored water from seeping out of an area of cloth surrounded by the glue (see Figure 2).This use of glue for masking was an innovation at the end of the 17th century in Japan, making it possible to produce colorful, pictorial clothes using only dyeing, without embroidery.The work of yuzen craftsmen is the creation of one-off, custom-designed, formal clothing or kimono garment, namely haute couture.The internet or online platform is perhaps the best place to attract interest of people to the craftsmanship from all over the world.
Objective
4The objective of this research is therefore to develop a simulator for hand-painted yuzen dyeing, providing an "easy-going" handcraft experience online.We believe that the hurdles of installing such an application are higher than expected.To achieve a highly realistic simulation for industrial purposes requires a rigorous watercolor painting algorithm 1 on a material model of silk. 2 As our purpose here is to provide an easy handcraft experience for F I G U R E 2 Four of many yuzen production stages.Drawing: Draw lines on the cloth with a flower-based, soluble dye, copying the design drawing.Masking: put masking glue along the lines.Dyeing: dye the cloth by injecting colored water with a thin brush.Then, "Steaming" (not depicted) to fix the color pigments inside the cloth.Washing: wash out the masking glue and flower juice.
5users, we developed a simplified and lightweight algorithm specialized for yuzen-style thin-brush dyeing with masking glue.Thin-brush yuzen dyeing is almost like watercolor painting.However, there are clear differences that require modification to allow us to simplify the watercolor painting algorithm.While the primary goal of the simulator development is to provide an easy-going and enjoyable handcraft experience, rather than reality, often a set of physically realistic parameters may be useful to tell the craftsmanship.To evaluate the present algorithm and determine a few unknown physical parameters, we conducted an experiment in which we measured the diffusion and evaporation of injected water on silk cloth.These parameters are also useful in future when developing a more realistic yuzen dyeing simulator.
Contributions
6In the present research, we derived a specialized algorithm for yuzen dyeing based on the foundations of fluid mechanics.Characteristics of yuzen dyeing allow us to reduce the computational burden of fluid dynamics.Our approach is in the similar vein to [3][4][5] aiming for a simple and fast algorithm at the expense of physical reality.The resulting algorithm is very similar to that of Zhang et al. 4 for "ink wash painting," with a restricted number of ink colors (black only) and flexible in terms of variety of brush stroke styles.As Zhang et al. 4 and Takeishi and Sato 5 proposed algorithms specialized for ink wash and watercolor, respectively, these algorithms are not fully suitable and optimized to handle some characteristics of yuzen dyeing.For these reasons, the present novel algorithm for yuzen dyeing can be both simple and easy to implement.One of the contributions of the present work is the theoretical derivation of the algorithm from the diffusion/advection system.Both Zhang et al. 4 and Takeishi and Sato 5 appear to lack theoretical justification, and the derivation of the algorithms was not described.We also theoretically justified the parameter regions to prevent or inhibit oscillating water flows, instead of implicitly setting them as constant.This theoretical derivation may be useful for future developments of similar algorithms.This specialization to yuzen dyeing may narrow the scope of application.However, this algorithm is still usable for (nonexpert) watercolor painting, or more specifically playing with coloring books.Line drawings are printed on coloring books.By seeing line drawings as masking glue, one can provide a different-style playing experience.A simple, easy-to-implement, fast, and lightweight algorithm is desirable for applications for education of culture at school.
RELATED WORKS
7Watercolor painting is considered as a part of research on realistic animation of liquids or fluids in general. 6An algorithm for computer-generated watercolor painting has been developed by simulating a physically realistic system of layered component models for each of water, pigments, materials, brushes, and others. 1 Using the algorithm, Curtis et al. 1 generated very realistic watercolor paintings.Although a great achievement, this requires much computational power and resources in exchange for mimicking the reality.Indeed, computational fluid simulation as a basis of watercolor simulations is generally both computationally costly and unstable, that is, it is hard to perform simulations in real time and long term.Kunii et al. 7 developed a very basic simulation method for Chinese ink painting.Way et al. 8 developed a physics-inspired model for Chinese ink painting and obtained beautiful artworks.Xu et al. 9 developed a hybrid grid-based and particle-based method for solving three-dimensional fluid dynamics, whose applications include digital painting.
8Regarding computer simulations for dyeing, Morimoto et al. 2 developed a physically realistic model and achieved highly realistic results including pigment dynamics along yarns.Evans 10 applied Morimoto et al.'s 2 algorithm to a specific dyeing technique called "tie" or "folding."Algorithms 1,2,6 compute the underlying direct differential equations of fluid mechanics.However, it had been known that direct methods are often unstable.In an influential paper entitled "stable fluids," Stam 11 derived a computationally stable and efficient algorithm for fluid simulations on the theoretical foundations of fluid mechanics (see also Reference 12 relating their algorithm to implicit methods).The derived algorithm is sufficiently simple, and easy to implement.It may be nonrealistic and inaccurate because of the early stopping-trick for fast computation of the diffusion equation on the way to achieving real-time performance.However, it offers sufficiently desirable visual quality for many real-time applications such as video games.Harris 13 is a tutorial on the direct/implicit methods based on fluid mechanics.Recently, DiVerdi et al. 14 represented color water on the canvas by a collection of polygons "splats" and formulated the diffusion/advection by stochastic dynamics of the vertices of the polygons.DiVerdi et al.'s 14 algorithm provides a more sparse representation of the canvas than the grid-based ones while producing sufficiently realistic pictures.
9In another approach, algorithms that involve nonrealistic procedures but produce visually acceptable results have been developed.In early work on nonrealistic watercolor simulations, Small 3 proposed a system of cellular models to represent the water and color (pigment) channels of a digital image.The fluid dynamics on the cellular system was achieved by diffusion and advection.Zhang et al. 4 developed an algorithm specialized for "ink wash painting" by combining a brush stroke algorithm and the diffusion/advection cellular system.Zhang et al. 4 modeled a brush itself by a 2D cellular system to simulate ink behavior in a tilted brush.Takeishi and Sato 5 proposed a mean filter-based algorithm for watercolor painting, simulating the ink blur effect on the canvas.Based on a cellular system, Takeishi and Sato 5 considered brush pressure to dynamically adjust the velocity of water/color injection.Although these authors reported that their algorithms yield visually interesting results, they appear to lack theoretical justification.In any case, the derivation of the algorithms was not described.
Characteristics of hand-painted yuzen-dyeing
10Yuzen dyeing has some remarkable characteristics in comparison with watercolor painting in general, as presented below.
11• The canvas is a silk cloth, a piece of textile made of an interlocking/interwoven bundle of yarns, called "warps" and "wefts" for vertical and horizontal yarns (Figure 3 Left).Both warps and wefts are typically the same thickness.As a result, the texture of a silk cloth can be seen to have the appearance of a cellular checkerboard, with black cells for warps and white cells for wefts.Each cell-like region of the cloth can hold water within it.
12• A small amount of water on the thin brush tip is commonly injected.In yuzen dyeing, "injection" means only touching the thin brush tip on the cloth, so that the colored water is transported from the brush tip to the dry cloth.Due to the cellular structure of the cloth, the velocity of water flow through the cloth is typically slow (e.g., slower than water on the paper surface).
13• Wet regions of the cloth looks darker than dry regions.This is an interesting feature of yuzen dyeing.To dye, you put colored water on a region, and then the color of that region initially looks darker than its final color after the water dries out.Evaporation of water on the cloth is usually not fast enough for humans to keep watching it, but it definitely gets progressively lighter.Novices find it hard to predict the resulting color on the cloth, while experts can do this with ease.
14• Masking glue plays the role of "breakwater" and can be located anywhere on the cloth, which determines interior boundary conditions.Usually, masking glue is placed to determine patches of drawn objects within which gradation or mixing of watercolor pigments is bounded.In the manufacturing process, the masking stage is always followed by the dyeing stage.In real dyeing, colored water might flood across masking glue unless the latter is properly attached.
Basic idea of the algorithm
15The first characteristic may allow us to adopt a relatively coarse-grained mesh for the 2D canvas, because the cloth is roughly grid-like in nature.The second characteristic may allow us to adopt an approximated velocity field, that is, without explicit representation.Indeed, the proposed algorithm for yuzen dyeing maintains only the density fields for water and color pigments.We assume that the velocity between two neighboring cells is proportional to the density gradient between them.This idea is known as Fick's first law of diffusion.The density gradient of water is used to determine the flow velocity to transfer and update the density fields of water and color pigments.In technical terms, advection occurs along diffusion.By dropping manipulation of velocity fields, the computational cost is reduced by a factor of around 1/3.Hence, if the appearance of the simulated water flow is acceptable, it improves real-time performance and facilitates implementation, both desirable for computer graphics.Note that we do not intend to say that in real yuzen dyeing the water flow velocity is considered to be constant.This is postulated for reducing the fluid model complexity.Similar ideas have been presented elsewhere. 3,4All five physics-inspired processes involved in the simulation are illustrated in Figure 4.
Notation
16The algorithm is based on the idea of finite difference.The forward time and centered space (FTCS) scheme is adopted with equally-spanned time steps of size h and equally-spaced 2D grid of side length s.Denote by n the time interval [n h, (n + 1) h] and by (i, j) the square space centered at ((i + 1∕2) s, (j + 1∕2) s) with side length s.Denote by x n i,j the amount of a quantity x in grid cell (i, j) at iteration n and by x n and X n the scalar and vector field of the quantity, respectively.Unless ambiguous, we also denote x n ij without separator.As is in watercolor painting models, we adopt a three-layer model to represent the system: water layer w n of size (N + 2) × (N + 2), pigment layer C n of size (N + 2) × (N + 2) × 3, and material layer Y n of size (N + 2) × (N + 2) × 3, where the number of color dimensions is assumed to be 3.To describe the algorithm, we denote one of the color dimensions by c n and y n for short.The water and pigment layers represent the fluid dynamics at the shallow level of the cloth, and the material layer represents the deep level of the cloth for pigment adhesion onto yarns.Exterior and interior boundary conditions are represented by breakwater threshold m n of size (N + 2) × (N + 2).Internal boundary condition represents masking glue, which can be placed arbitrarily on the cloth.The algorithm has a few parameters, diffusion factor (and ), cell capacity , evaporation factor , absorption factor , and breakwater level , described later.
17The algorithm for updating these variables is fully described in Algorithm 1.The update routine can be implemented with less than 30 lines of code in C and less than 20 lines in Python NumPy.
Algorithm 1. Hand-painted yuzen-dyeing algorithm
18Input: Current state of water w 0 , pigments C 0 , material Y 0 , and masking glue m 0 ,cell capacity ,flow limit factor 1∕ ≤ 1∕4,diffusion factor = h∕s 2 ≤ 1∕5,evaporation factor ,absorption factor ,breakwater threshold .Output: Updated state of water w 1 , pigments C 1 , material Y 1 .copy w 0 to w 1
Diffusion of water
19The diffusion equation w t = ∇ 2 w is commonly approximated by finite difference
20Rearranging the terms gives the explicit method for evolution
21where the summation takes over the von Neumann 4-neighborhood of (i, j).Denote by B ij the set of cell indices for the von Neumann 4 neighbors of (i, j).This explicit method (and the like) is commonly not preferred in computer graphics practice, because it is largely numerically unstable.However, we start with this equation to derive the algorithm, as the explicit method is simple and fast.
22As described so far, the silk cloth or canvas is composed of aligned cells in 2D, which is roughly approximates a grid-like structure.Let us identify these cloth cells as the grid cells of the finite difference.Each cloth cell has a finite capacity for holding water.Therefore, the fluid dynamics may have specific constraints.
Outflow is overflow.
23First, we assume that water flows out of cell (i, j) only when the amount of water w n ij exceeds the capacity , that is, w n ij > and no outflow occurs otherwise.Thus, the total amount of outflows from (i, j) must be less than the amount of water exceeding the capacity .Oscillating flow rarely happens.Second, we assume that water can only propagate through the cloth internally and so ripples or capillary waves, or backflows in turn, may rarely happen.Thus, after an amount of water f w flows out from (i, j) to some of the neighbors, the resulting amount of water in (i, j) should be more than the amount of water in each of the neighbors.
24To incorporate these constraints to the fluid system, we take a fool-proof approach.Although an actual complex process may require watchful and case-by-case treatments, we avoid such costly treatments by identifying the ranges of the system parameters that are almost stable and secure, that is, those with no noticeable violation of desirable ranges of these fluid variables.
25To introduce the first constraint, consider the second summation term of Equation (3) which is the sum of inflows and outflows.Partition the four neighbors based on flow direction and construct the set of cells with inflow,
and the set of cells with outflow,
26Given the limited capacity, the total amount of outflows must satisfy
27Testing this requirement is possible but still complicated because some flow correction strategy must be implemented.For the algorithm, as is developed for a relatively relaxed experience, we radically simplify by restricting the range of outflows:
28where −f w is the amount of outflow and we put
29By multiplying −1, the sign of outflow is now dropped in the term f w ≥ 0. By replacing the term (h∕s 2 )(w n kl − w n ij ) in Equation ( 5) with −f w from Equation ( 6), the constraint Equation ( 5) must always be satisfied, since they are all positive or zero for all (k, l) ∈ O n ij .Due to the symmetry of inflows and outflows, the same restriction applies for inflows (or outflows) of neighbors.By constantly choosing = 4, regardless of context-dependent O n ij , the simulation securely works with low computational cost, at the expense of accuracy.Equation ( 6) appears in Algorithm 1 Line 11.
30Consider the second constraint.Again, as oscillation of wave is a global phenomenon, it seems that completely avoiding oscillation of wave is impossible by only considering some constraints imposed on local interaction.Here we consider a local constraint, which is only sufficient, and augment this in Section 4 by employing a numerical experiment to evaluate its effect.To derive a local constraint for avoiding oscillation of water flows, our approach is to only consider the optimistic case, which may reduce the implementation difficulty.Approximately the optimistic case frequently happens in yuzen dyeing that injecting water into a single cell in a nearly uniformly dried/wet region, that is, all the neighboring cells contain approximately the same amount of water possibly zero.From Equation (3), the local constraint can be expressed by
31Under the assumptions of the optimistic case, that is, w n kl are the same constant for all four neighbors (k, l), this equation is reduced to
32which is a form of stability condition in the optimistic case.Remark that the above condition is not necessary but only sufficient.As it only captures the optimistic case, there are configurations of neighbors w n kl violating Equation (7).Consideration of this optimistic case is justified by typicality of the situation in our application.
33A necessary but insufficient case of the second constraint is that the amount of water w n+1 ij in cell (i, j) can never be negative.Indeed, the case can be expressed by
34and the same worst-case argument leads to = h∕s 2 ≤ 1∕4.Thus, by setting ≤ 1∕5, also the system satisfies the above non-negativity constraint, as required for appropriate and stable fluid dynamics.Note that, if one takes some 1∕5 ≤ ≤ 1∕4, a ripple or capillary wave can happen while still nonnegative (see Section 4).
Advection of pigments
35The number of pigment kinds, or color dimensions, is irrelevant when deriving the algorithm.For that reason we suppose there are three pigments, for example, cyan, magenta, and yellow.In actual yuzen dyeing, a variety of natural pigments are used and they may have different characteristics.Moreover, we suppose that these pigments in each cell are uniformly mixed within the water of that cell.Under this assumption, the amounts of transport of these pigments are proportional to the amount of transport of water caused by diffusion.Simply put, we implement that advection of pigments occurs only along diffusion of water.Given the amount of a pigment c n ij , and the amount of water outflow f w ≥ 0 from cell (i, j) to a neighbor, the amount of transport of the pigment, f c ≥ 0, is defined by
36If the two constraints are imposed, 0 ≤ f w ∕w n ij ≤ 1 is restricted.Equation ( 10) appears in Algorithm 1 Line 15.
Evaporation of water and absorption of pigments
37Evaporation of water on the cloth and absorption of pigments into the cloth are mostly processed as follows.The processes are similar to those in a physically realistic watercolor painting algorithm 1 but simplified for this relaxed simulator for yuzen dyeing.Evaporation of water w n ij is implemented simply as an exponential decay by factor . Absorption of pigments from water w n ij into the cloth y n ij is also an exponential decay by factor . Evaporation and absorption are implemented in Algorithm 1 Lines 23, 24, 26-28, respectively.
38To behave securely, at this stage, it might be better to fix all the values of w n ij < 0, c n ij < 0, and y n ij < 0 at zero, if such cases happen due to numerical errors.
Flood across breakwater
39In real yuzen dyeing, water with pigments could flood across/over masking "breakwater" glue unless properly attached.This phenomenon is implemented by simply introducing a threshold level .Even if a neighbor cell is poorly masked, water flows out into the cell when the amount of masking glue is smaller than the threshold, m n ij < .This appears in Algorithm 1 Line 5. By visualizing the levels of masking glue indistinguishable for humans, the user may be surprised by unexpected water flooding across/over masking glue.This is usually experienced in the real dyeing stage and often in handcraft workshop.We consider this a door to knowing the craftsmanship.
Conservation of the amount of water and of pigment
40It is natural that the system preserves the total amount of water and of every pigment, allowing for evaporation and absorption.The presented algorithm holds this conservative property as shown here.Suppose evaporation and absorption never happen.In this algorithm, this conservative property is obvious, because between two neighboring cells inflow and outflow occur symmetrically (Algorithm 1 Lines 12, 13, 16, and 17).Given the restrictions in outflows discussed in this section, outflows happen within the valid and secure range of simulation.The algorithm detects only secure outflows, calculates inflows by reversing the direction, and exchanges the same amount of a quantity.There is no room for dissipation.
Injection and visualization of water and pigments
41To complete the yuzen-dyeing simulator, we have to make technical choices for other components of the simulator, such as input devices and color schemes.Those choices are briefly described in this section and not always justified.Those can be investigated in future works.Visit the p5js project (see Section 6) to see the source code and the implementation detail.
42There can be several choices for injection of water and pigments.Suppose the user specified the location and trigger of water injection by a pointing device.We used an additive scheme in which water with pigments is added to the pointed cell constantly, with no limitation on the maximum amount (thus the height of each cell barrier is so high if we refer to Figure 4; not to be confused with cell capacity , which is the height of the pipes).This can be interpreted as the thin brush with water and pigments itself being an extension of the pointed cell while it is attached onto the cell.Because of the rapid spatial diffusion process of this algorithm in real time, the amount of water in the injection cell stays within a small range of values if it can spatially diffuse.A saturation function such as min{w n ij , 1} should be used when visualizing the current state of the wet cloth that looks darker (here we assume that the human recognizable color range is upper bounded to the value 1).This produces visually acceptable results.Moreover, this is a way to achieve faster water flows in the algorithm, in which the potential (height) field of water is translated to approximate the velocity fields of water.
43Pigment colors are internally represented in the subtractive CMY color model.Thus, the accumulation of color pigments (Algorithm 1 Lines 27 and 28) on the pigment and material layers is simply computed by arithmetic addition and subtraction.A subtractive color model is preferred as increasing the intensities of color components resulting in black is natural for paints, inks, and dyes.The simulator allows the users to choose any colors from the HTML5 Color Picker on the additive RGB color model.However, it is immediately transformed into the subtractive color representation.To visualize both pigment and material layers, similarly to the water layer, the saturation function, for example, min{c n ij + y n ij , 1} should be used.
44The pigment and material layers c n ij + y n ij , the water layer w n ij , the masking glue layer m ij are rendered in this order.The amount of water w n ij and the amount of masking glue m ij are translated into the alpha component to black to visualize them.
Performance comparison
45Although many watercolor painting algorithms show the computational complexity O(N 2 ), where N is the number of rows/columns of the cellular models, the magnitude is still a major concern for realizing real-time applications.As one of the goals of this article is to develop a faster diffusion-advection algorithm by restricting the domain of its application to include yuzen dyeing, we compared its performance in time, with a few existing algorithms. 4,5,15In this comparison experiment, we excluded the stable fluid 11 because its computational complexity is obviously higher than the others as described below.
46A difficulty to perform a comparison of these algorithms is that many of these algorithms are specialized for their applications.For example, none of the previous algorithms were developed to handle masking glue, one of the characteristics of yuzen dyeing (although one may emulate this by setting glue thicker than the kernel size).As a fair comparison, we simulated only the diffusion of water injected at the center of the canvas.It is common to all these algorithms.Although we developed our yuzen dyeing simulator in JavaScript p5js for online, we conducted this performance experiment in Python for convenience of debug and unit tests.
47Takeishi and Sato's 5 algorithm for watercolor painting is basically based on the generic non-separable mean filter computing 2D convolution.Rigamonti et al. 15 considered separable mean filters for faster 2D convolution and showed that separable filters require (3 + 3) × N 2 steps, where N × N is the canvas size and 3 × 3 is the size of convolution kernel, while non-separable filters require (3 × 3) × N 2 steps.By restricting types of convolution kernels, one can achieve faster computation time.The stable fluids 11 shows the computational complexity O(N 2 ).However, the actual computation includes 3 × 20 iterations over N 2 cells (i.e., the Gauss-Seidel procedure for the density field and two velocity fields) to solve the diffusion equations.This computational burden is more than 3 × 20 × (1 + 4) N 2 = 300 N 2 steps per iteration.Not surprisingly, a generic fluid simulator necessitates a larger computational burden.
48For Algorithm 1, we only implemented Lines 1-4 and 8-13, the core parts of the diffusion of water.We fixed = 1∕5 and = 4 and changed = 0.0, 0.01, 0.1.Since the algorithm updates cells only when outflows are detected in Line 10, its computation time depends on the number of cells containing water more than capacity .So that estimation of its computational complexity is not straightforward.Zhang et al.'s 4 algorithm for ink wash painting is very similar to Algorithm 1 if we only consider the water diffusion process.Therefore, throughout this comparison experiment, we identify Zhang et al.'s 4 algorithm and our Algorithm 1.
49To achieve a fair comparison, we implemented all those algorithms in Python with for loops, and we did not use NumPy/SciPy 2D convolution filters.In the experiments, the canvas size is 100 × 100.From the initial state with a unit amount of water at the center, the times required to compute 100 iterations are measured for each algorithm.We conducted 100 independent runs for each algorithm and analyzed the average time.
50Figure 5 (top) shows the cumulative computation times from the 0th to 100th iteration.Figure 5 (bottom) shows the average computation times at each iteration.As expected, the computation times of the non-separable (full) and separable filter method increase linearly as a function of iteration number, and the separable filer is faster than non-separable (full) one.The computation times of Algorithm 1 with = 0.01 and 0.1 increase linearly and ware faster than the separable filter.However, The time of Algorithm 1 with = 0.0 shows non-linearity: it is faster than the separable filter fist but eventually slower than the separable filter.This can be happened because of the presence of Lines 10-13, so that the computation time per iteration depends on the number of non-empty cells, w 0 ij > = 0. Importantly, if cell capacity is sufficiently high compared to the total amount of injected water, this works to improve the computation performance.By incorporating water evaporation process, we may achieve further performance improvement, allowing us to implement the online yuzen dyeing simulator in JavaScript.
NUMERICAL VALIDATION
51To evaluate if the algorithm can satisfy the required constraints within the derived ranges of the parameters (, ), we conducted numerical experiments.The constraints required include (1) conservation of mass (water and pigments), (2) non-negativity of mass, (3) "outflow is overflow" (Equation 5), and (4) "oscillating flows rarely happen" (Equation 7).These were directly tested for all cells throughout iteration, and the number of cells satisfying each constraint was counted.Additionally, "oscillating flows" was doubly examined to reflect its visual appearance by counting the number of local minima along the cells in the middle row.To test oscillatory flow, the initial state of the fluid simulation experiments was constantly assumed to be a unit mass only on the center cell.Other constant parameters were as follows: the number of active cells N × N = 9 × 9, the number of iteration 5.As well as 2D simulations, we performed 1D simulations, for which the parameter ranges, 1∕ ≥ 3 and ≥ 2, can be derived similarly to the 2D case.Because the result was qualitatively the same, below we report the 2D case only.
52Figure 6 shows two observations from the 2D simulation experiment: one with 1∕ = 4.5 < 5, = 4.5 > 4, and = 0, in which oscillation may happen, and the other with 1∕ = 5.5 > 5, = 4.5 > 4 and = 0, in which oscillation might only rarely happen.To visualize the 2D dynamics, the time evolution of the middle row is only shown in each figure.These two observations cross the boundary case 1∕ = 5, above, for which the theoretical result in the last section predicts that oscillating flows could be inhibited.The simulation results are consistent with the theoretical result.
53Figure 7 shows the percentage of satisfaction of the four constraints throughout simulations, with parameters = 3.0, 3.03, … , 6.0, = 3.0, 3.03, … , 6.0, and = 0.0, 0.05, … , 0.9.The value "100%" means that all the four constraints are satisfied throughout the simulations as required.Consistently with the theoretical results, the algorithm can satisfy the all four within 1∕ ≥ 5 and ≥ 4.However, some violations may occur.The mass conservation is always satisfied (as proved).The non-negativity could be violated if 1∕ < 4 (as proved).The capacity is violated if < 4 (as proved).Oscillation can happen if 1∕ < 5 (as proved).All the experimental results are consistent with the theoretical results.
54Figure 8 shows the yet another quantification of oscillating flows by the number of local minima along the middle row.Consistently with the theoretical results, no oscillating flows occur within 1∕ ≥ 5 and ≥ 4.However, oscillating flows are observed if 1∕ < 5.
PHYSICAL EXPERIMENTS
55To identify a set of the parameters that produce acceptable appearances, we conducted a series of physical experiments on yuzen dyeing.Since this dyeing simulator was not originally developed for realistic simulation, the physical experiments are not intended to validate the reality of the fluid algorithm.Although this simulator can provide an enjoyable experience despite the lack of realism, it is preferable for some realistic aspects to be included.
56In physical experiments, only the diffusion of water was investigated for the following reasons.In real yuzen dyeing workshops (a learning space), participants create colored water by mixing liquid dyes to water.It viscosity seems almost unchanged.Furthermore, participants are allowed to use liquid glue to control the viscosity of water, making diffusion slower.So that identifying the pure water diffusion would be sufficient for the purpose of the development of this simulator.It can be used as a no-liquid-glue baseline of realistic water diffusion.Some video clips of the physical experiments are available online (see Section 6).
57In physical experiments, propagation of water injected by a thin brush on a silk cloth for real yuzen was captured using a digital 4K video recorder (Sony FDR-AX45), at 60 frames per second and image resolution 1920 × 1080 pixels.As shown in Figure 9, the video camera was fixed on a tripod to capture the subject from the front.The cloth was taut on a rectangular icon frame.Water was injected at the nine points on the cloth marked evenly-spaced 3 by 3 black dots in Figure 9.The brush was dipped into water immediately before each injection.The brush was touched on the cloth for approximately 2 s from the left-top to the right-bottom point in sequence as indicated in Figure 9, to reduce the shadow of the hand on the cloth around the injection points.Under air conditioning, the temperature was 24.3 • C and the humidity was 37% at the beginning of recording.The influence of color pigments was not examined, because it was not explicitly modeled in the simulation algorithm.
58The change of pixel values in gray scale intensity due to propagation of water through the cloth was analyzed.Given the video image coordinates, "water spots" created by injection were within a 60-pixel radius.To remove the unevenness of the cloth surface, a Gaussian filter with the unit variance was applied to each video frame image.For each frame, the pixel values around the center-to-the-top and the center-to-the-left axes were extracted and averaged over all nine points depending on the distance from the center.That is, the 9 injection points were treated as 18 samples by assuming directional symmetry of propagation.As a result, for each video frame, a single vector of size 60 was obtained, whose 60th F I G U R E 9 Physical experiment setup (left) and water injection points (right).The nine black dots for injection points are detected using OpenCV.
59element indicates the 18-sample average intensity of the farthest point from the injection center and its 0th element the 18-sample average intensity of the center.This is called the "intensity vector."The intensity of cloth color was relativized to that of the dry cloth color detected within each video frame image.
60Figure 10 shows the time evolution of the intensity vectors.Because the black dots indicating the centers were detected as high intensity, the intensity vector at the start frame of water injection (Ink start at 0 s) was regarded as a baseline and subtracted from the subsequent intensity vectors.The intensity vector at 1∕3, 1∕6, 1, 2 (Ink end), 5 s are also depicted.It shows spatio-temporal propagation dynamics of injected water or creation of water spots on the cloth in realistic dyeing situations.
61Figure 11 shows a simulated propagation dynamics using the developed simulator in the present study.The amount of water injection per frame (30 frames/second) was w I = 3 and cell capacity = 0.3.Other parameters used were 1∕ = 5 and = 4 (corresponding to the fastest possible flows within the stable region shown in the last section) with no masking glue and evaporation.Despite the simulated algorithm adopting a radically "deformed" water flow model on the cloth, it shows qualitative similarity in that a saturated waterfront moves from the center to the distal while attached to the brush and then shifts to the solely diffusive phase after detaching from the brush.This qualitative similarity could be achieved by influence of cell capacity, taken into account in this study.
62To estimate the real evaporation rate , the physically observed time evolution of the 20th element of the intensity vectors is shown in Figure 12 Given the actual amount of water at cell w ij , the graph shows sat(w ij ) = min{w ij , 1}, where sat is a saturation function.
F I G U R E 12
63Evolution of the physically-observed intensity of the 20th element from the water injection center.The exponential decay process for evaporation was fitted with a log-linear model.arbitrarily, and mostly similar results can be obtained for the 10th, 30th, and 40th elements (because the exponents of exponential decay processes do not widely differ).In this figure, three stages are recognized: (1) rapid increase in intensity for 0-2 s during water injection, (2) rapid decrease in intensity for 2-60 s due mostly only to diffusion, and (3) slow decrease in intensity after 1 min due mostly only to evaporation.To identify realistic evaporation rate, we fitted the decay curve with a log-linear model y = e at+b for the exponential decay process given a time-series segment for t = 1 to 3 min.The result was a = −0.37 and b = 2.86 with the root-mean-square error 0.145.As the unit of time was the minute, the estimated evaporation rate is 0.37∕3600 ≈ 0.0001, representing realistic evaporation.Note that for simply enjoying yuzen-like dyeing using this simulator, this realistic evaporation rate seems very slow and likely to induce boredom.However, it may be useful for some cases.
64Although other pigment-related parameters exist, these are barely estimated within the experimental environment we used.Based on our own yuzen dyeing experience, we recommend absorption factor = 2 to 5 .The amount of color pigments contained in an amount of water as proportional to the amount of water seems to work nicely.
ONLINE YUZEN-DYEING SIMULATOR
65Interested readers can visit the project and experience the simulator online, or watch a video clip on the Open Science Framework1 .Some real examples, simulated artworks, simulation videos, and video clips of the physical experiments are available.We implemented the simulator on p5js, a JavaScript library having an affinity with Processing.The simulated cellular model consists of size 150 × 150 cells and scaled by factor 4 to present the results to the user.No interpolation is used because the silk cloth for real yuzen actually has a cellular appearance.We recommend using Google Chrome, which seems to offer the best-performing JavaScript engine.On our laptop, the simulator can achieve nearly 30 frames/second when using Google Chrome.
CONCLUDING REMARKS
66In this work, we developed a yuzen dyeing simulator to provide an "easy-going," online handcraft experience.By considering the nature of yuzen dyeing stuffs and materials, we radically simplified the computation model and developed the algorithm, which successfully reduced the usually heavy computational burden of fluid dynamics.The simulator can produce apparently yuzen-style painting works.Thus, the objective of this research was fulfilled.Although the objective is not focused on the physical reality of the simulation, we conducted a series of physical experiments and demonstrated several levels of qualitative resemblance between simulator-produced and real items.Some physical parameters identified in this research may be useful for developing future realistic simulators.
67It may be noted that several characteristics of the fluid dynamics in yuzen dyeing were not replicated, given how the yuzen dyeing algorithm was designed.Probably the most influential one concerns the limitation in the fastest water flow velocity.Since the algorithm does not handle the velocity fields explicitly, the largest distance or number of cells colored water moves across within a unit time interval is always 1, that is, the water dynamics is restricted only to cross into neighboring cells.This arose from the trade-off between the reality of simulated flows and the lightness of the computational burden to achieve it.We prioritized the latter to develop a simulator for easy use.The resulting simulated water flow appears satisfactory for this purpose.Of course, if available, realistic yuzen dyeing simulators would be desirable for educational and design purposes.Such simulators could be realized by combining the present work with other developments in computer graphics such as the watercolor painting algorithm 1 and stable fluids 11 with the realistic dyeing simulation. 2 For example, directional colored water flows along horizontal/vertical yarns could be replicated-as on a black-white checkerboard, by interweaving two, mostly independent, three-layer cellular systems corresponding to the two orthogonal directions of yarns. 2
F I G U R E 3
68Left: The interweaving structure of the silk cloth.The circle indicates one of the nine "cells" contained in the figure.Right: A schematic of the simulated cellular model of the material.The arrows indicate injection of colored water into the cell.
69Five physics-inspired processes involved in the fluid simulation are illustrated: Diffusion, advection, evaporation, absorption, and injection.
7 d w = w 0 kl − w 0 ij 8 d
70= − w 0 ij 9 if d w <0 and d <0 then 10
F I G U R E 5
71Performance comparison of algorithms.
F I G U R E 6
72Examples of simulated 2D fluid dynamics.Only the evolution of the middle row is shown.Left: Oscillating flows.Right: Non-oscillating flows.F I G U R E 7Numerical validation for satisfaction of the four constraints.
F I G U R E 8
73Numerical examination for generation of apparent oscillatory flows.
74over the 3 min from the start of water injection.The 20 position from the center was chosen F I G U R E 10 Evolution of the physically-observed intensities of cloth color at the 60 positions from the water injection center (the 0th pixel).F I G U R E 11Evolution of the simulated intensities of cloth color at the 20 positions from the water injection center (the 0th pixel).
참고문헌 11건
- GPU Gems: Programming Techniques, Tips and Tricks for Real-Time Graphics 2004
- Dyeing in Computer Graphics InTech eBooks · 2011 10.5772/21236
- Computer‐generated Chinese color ink paintings Journal of the Chinese Institute of Engineers · Taylor & Francis · 2006 10.1080/02533839.2006.9671203
- Realistic Animation of Liquids Graphical Models and Image Processing · Academic Press · 1996 10.1006/gmip.1996.0039
- TWO-DIMENSIONAL DIFFUSION MODEL FOR DIFFUSE INK PAINTING International Journal of Shape Modeling · World Scientific · 2001 10.1142/s0218654301000047
- Painting with Polygons: A Procedural Watercolor Engine IEEE Transactions on Visualization and Computer Graphics · Institute of Electrical and Electronics Engineers · 2013 10.1109/tvcg.2012.295
- Computer-generated watercolor 1997 10.1145/258734.258896
- Simple cellular automaton-based simulation of ink behaviour and its application toSuibokuga-like 3D rendering of trees The Journal of Visualization and Computer Animation · Wiley · 1999 10.1002/(sici)1099-1778(199901/03)10:1<27::aid-vis194>3.0.co;2-c
- Real-time ink simulation using a grid-particle method Computers & Graphics · Elsevier BV · 2012 10.1016/j.cag.2012.08.003
- Learning Separable Filters 2013 10.1109/cvpr.2013.355
- Stable fluids 1999 10.1145/311535.311548