Poisson Vector Graphics (PVG) and Its Closed-Form Solver
Fei Hou, Qian Sun, Zheng Fang, Yong-Jin Liu, Shi-Min Hu, Hong Qin, Aimin Hao, Ying He
PPoisson Vector Graphics (PVG) and Its Closed-Form Solver
Fei Hou , Qian Sun , Zheng Fang , Yong-Jin Liu , Shi-Min Hu , Hong Qin , Aimin Hao , andYing He ∗ Nanyang Technological University Tsinghua University Stony Brook University Beihang University
Abstract
This paper presents Poisson vector graphics, an extension of the popular first-order diffusion curves, forgenerating smooth-shaded images. Armed with two new types of primitives, namely Poisson curves and Poissonregions, PVG can easily produce photorealistic effects such as specular highlights, core shadows, translucencyand halos. Within the PVG framework, users specify color as the Dirichlet boundary condition of diffusioncurves and control tone by offsetting the Laplacian, where both controls are simply done by mouse click andslider dragging. The separation of color and tone not only follows the basic drawing principle that is widelyadopted by professional artists, but also brings three unique features to PVG, i.e., local hue change, ease ofextrema control, and permit of intersection among geometric primitives, making PVG an ideal authoring tool.To render PVG, we develop an efficient method to solve 2D Poisson’s equations with piecewise constantLaplacians. In contrast to the conventional finite element method that computes numerical solutions only,our method expresses the solution using harmonic B-spline, whose basis functions can be constructed locallyand the control coefficients are obtained by solving a small sparse linear system. Our closed-form solver isnumerically stable and it supports random access evaluation, zooming-in of arbitrary resolution and anti-aliasing. Although the harmonic B-spline based solutions are approximate, computational results show thatthe relative mean error is less than 0.3%, which cannot be distinguished by naked eyes.
Vector graphics provides several practical benefits over traditional raster graphics, including sparse representation,compact storage, geometric editablity, and resolution-independence. Early vector graphics supports only linearor radial color gradients, diminishing their applications for photo-realistic images. Orzan et al. [19] pioneereddiffusion curve images (DCIs), which are curves with colors defined on either side. By diffusing these colors overthe image, the final result includes sharp boundaries along the curves with smoothly shaded regions between them.Thanks to its compact nature and the ability of producing smoothly shaded images, diffusion curves quickly gainpopularity in the graphics field and inspire many follow-up works, such as improving runtime performance andnumerical stability [14, 26, 25], and generalization to 3D and non-Euclidean domains [15, 26, 27].Recent research has been focused on extending the expressiveness with more user control. Since Laplaciandiffusion does not natively support manipulation of the color gradient, higher-order interpolation is a possibleway for gradient control. Using thin-plate splines (TPS), Finch et al. [8] extended diffusion curves to providesmooth interpolation through color constraints while omitting the diffusion curves blur operation. Although TPSallows more user control and is able to mimic smooth shading, it often produces unwanted local extremals (herebyunpredicted effects) out of the user-specified regions due to the violation of the maximal principle of harmonicequation. Moreover, solving a bi-Laplace’s equation is more computationally expensive than solving Laplace’sequation, and it may suffer from serious numerical issues since the system is less well-conditioned. To removethe undesired extremals, Jacobson et al. [12] proposed a non-linear optimization guided by a harmonic function.Their method allows the user to specify the exact locations and values of the local maxima and minima, which is ahighly desired feature to authoring and editing. Lieng et al. [17] proposed shading curves, which associate shadingprofiles to each side of the curve. These shading profiles, which can be manually manipulated, represent the colorgradient out from their associated curves. However, the colors produced by shading curves are not as vivid asdiffusion curves. Recently, Jeschke [13] proposed generalized diffusion curve images (GDCIs), which spatiallyblend multiple conventional DCIs. Thanks to more degrees of freedom provided by all DCIs, GDCI is able toprovide a similar expressive power of color control as the TPS model and its solver is efficient and numericallystable. However, the blending functions are highly non-linear, making it difficult to design manually and control ∗ [email protected] a r X i v : . [ c s . G R ] J a n he extrema. Therefore, GDCI is often applied to image vectorization with simple editing (e.g., changing thecolors or modifying the curves), rather than being used as an authoring tool.This paper aims at overcoming the above-mentioned limitations of the existing DCI framework. Towards thisgoal, we present a new type of vector graphics, called Poisson vector graphics (PVG), which extends DCI byallowing non-zero Laplacians. To make a PVG, users first sketch a set of sparse geometric primitives (e.g., points,curves and/or regions) { γ i } Ni =1 . Then, for each primitive γ i , specify its Laplacian of color (cid:52) γ i = f i , where f i is a piecewise constant function defined on γ i . The final image is obtained by solving the following Poisson equation (cid:26) ∆ u ( x ) = f, x ∈ Ω \ ∂ Ω u | ∂ Ω = g, x ∈ ∂ Ω (1)where Ω is the 2D domain and the constraint f partitions Ω = (cid:83) Ni =1 Ω i so that on each subregion Ω i , f | Ω i = f i is a constant.PVG is a natural extension of DCI, which are rasterized via Laplacian diffusion (i.e., solving a Laplace’sequation ∆ u = 0). The seemingly minor change of replacing the zero Laplacian by a piecewise constant function f is indeed crucial for globally and locally controlling shading profiles, which are not able to achieve within thediffusion curve framework. Intuitively speaking, diffusion curve images are the result of diffusing the colors definedalong control curves until the color field reaches an equilibrium, which is a harmonic function. Since a harmonicfunction is completely determined by the Dirichlet boundary condition, diffusion curves do not allow manipulatingof color gradients. Although second-order diffusion curves [8][5] [11] support explicitly gradient control, they areusually difficult to use due to lack of intuitive interpretation between the manually manipulated gradients (whichare vectors ) and the desired shading effect. In contrast, PVG is the solution of Poisson’s equation, whose solutionspace is much larger than that of Laplace’s equation, hereby providing users more control of the image.Armed with two new types of primitives, namely Poisson curves and Poisson regions, PVG can easily producephotorealistic effects such as specular highlights, core shadows, translucency and halos (see Figure 1). Within thePVG framework, users specify color as the Dirichlet boundary condition of diffusion curves and control tone byoffsetting the Laplacian, where both controls are simply done by mouse click and slider dragging. The separationof color and tone not only follows the basic drawing principle that is widely adopted by professional artists (e.g.,see page 58 [10]), but also brings three unique features to PVG, i.e., local hue change, ease of extrema control,and permit of intersection among geometric primitives, making PVG an ideal authoring tool.To render PVG, we develop an efficient method to solve 2D Poisson’s equations with piecewise constantLaplacians. In contrast to the conventional finite element method that computes numerical solutions only, ourmethod provides a closed-form solution u ( x ) = (cid:80) λ i ψ i ( x ), where { ψ i ( x ) } are the basis functions of harmonicB-spline [7], and the control coefficients { λ i } are computed by solving a small sparse linear system. Similar to theconventional B-splines, the basis functions ψ i ( x ) have local support, therefore, evaluating the spline at a point x involves only the basis functions that cover x . Our solver is numerically stable and it supports random accessevaluation, zooming-in of arbitrary resolution and anti-aliasing. Although the harmonic B-spline based solutionsare approximate, computational results show that the relative mean error is less than 0.3%, which cannot bedistinguished by naked eyes.Figure 1: A Poisson vector graphics (PVG) consists of the popular diffusion curves (DCs) and two new types ofprimitives, called Poisson curves (PCs) and Poisson regions (PRs). By manipulating the Laplacian constraintsassociated with PCs and PRs, users can easily control global and local shading profiling and produce photorealisticeffects such as specular highlights and core shadows, which cannot be achieved by using DCs only. Thanks to ourclosed-form Poisson solver, PVG also supports random access evaluation, anti-aliasing and zooming in of arbitraryresolution. DCs, PCs and PRs are depicted by solid lines, dashed line and loops with hatches, respectively. This section briefly reviews the related work on various solvers for rendering diffusion curves and gradient domainimage editing. 2 .1 Diffusion Curve Solvers
To rasterize a DCI, one needs to solve a Laplace’s equation defined on the entire image plane. Since a directsolver is expensive, Orzan et al. [19] designed a multigrid solver, which uses a coarse version of the domain toefficiently solve for the low frequency components of the solution, and a fine version of the domain to refine thehigh frequency components. Although being fast, this solver suffers from aliasing and flickering artifacts due tothe rasterization of the curves over a discrete multi-scale pixel grid. Jeschke et al. [14] used finite differences withvariable step size to accelerate the convergence rate of Jacobi iterations, which guarantees the convergence to theright solution. Their method also supports zooming-in of arbitrary resolution by solving Laplace equation onlyfor the region of interest. However, since the boundary condition is obtained from the coarse domain, which is notaccurate enough, numerical issues may occur near the boundary. To overcome these limitations, Boy´e et al. [5]developed a finite element method (FEM) based biharmonioc equation solver, which dynamically converts a DCIinto a high-order mesh-based representation that is automatically adapted to the complexity of the input curves.Such an intermediate triangulation, hidden from the user, is updated only when diffusion curves are edited.Moreover, their solver directly deals with gradient constraints. Their solver is ideal for (bi-)Laplace equations,but it is unclear whether it can be directly extended to Poisson equations.Motivated by the parallel between diffusion curve rendering and final gathering in global illumination, Bowerset al. [4] developed a stochastic ray tracing method that allows trivial parallelism by using shaders and provides aunified treatment of diffusion curves with classic vector and raster graphics. However, it densely computes valueseven in smooth regions and sacrifices support for instancing and layering. Later, Prevost et al. [22] improved theray tracing method by using an intermediate triangular representation with cubic patches to synthesize smoothimages faithful to the per-pixel solution.Another family of methods for rasterizing DCIs is to use boundary element method (BEM), which rephrasesLaplace’s equation as a boundary integral along control curves. Sun et al. [26] formulated the solution as asum of Green’s functions of Laplacian. Thanks to the closed-form formula, this approach is quite fast andenables integrating the solution over any rectangular region, which allows anti-aliasing. However, it requires pre-calculating the weights of the Green’s function kernels, which depends on normal derivatives along the controlcurves. As a result, it can only take a DCI with fixed geometry and color constraints as input, and is not suitablefor interactive authoring. Ilbery et al. [11] proposed a BEM based solver for rendering TPS vector graphics ina line-by-line manner. Sun et al. [25] presented a fast multipole representation for random-access evaluation ofDCIs. Their method is able to achieve real-time performance for rasterization and texture-mapping DCIs of upto millions of curves.Most DCI solvers require GPU acceleration to achieve real-time performance. Aiming at efficiently renderingDCIs on devices with only a CPU, Pang et al. [20] developed a mesh-based approach, which sets the diffusioncurves as constraints in triangulation and employs mean value coordinate-based interpolant to estimate vertexcolors. Their algorithm supports random access evaluation, but the produced DCI is only an approximation andit may suffer from the aliasing issue.
Solving 2D Poisson’s equations plays an important role in various image processing tasks, such as composition [21,1], alpha matting [24], colorization [16], filtering and relighting [3]. Fast Fourier transformation (FFT) is a popularmethod to solve Poisson’s equation in rectangular domains due to its high performance. For irregular domains,one often adopts the finite element method (FEM), which subdivides the domains into smaller parts and solvesa large sparse linear system.Poisson image editing [21] enables seamless cloning by matching the gradients of the source and the targetimages, which is formulated as a Poisson’s equation. However, directly solving such an equation is computationallyexpensive. Agarwala [1] improved the scalability by using quadtrees to substantially reduce both memory andcomputational requirements. McCann and Pollard [18] presented a multi-grid Poisson solver on GPUs, withwhich they can achieve real-time interactive performance. Taking the source image as the solution of a Poisson’sequation under a different boundary condition, Farbman et al. [6] converted the Poisson problem to a Laplaceproblem, which can be solved efficiently using mean value coordinates [9].In contrast to the above solvers for general Poisson’s equations, our solver is for a special type of Poisson’sequation, where the function f is piecewise constant. We derive the closed-form solution using harmonic B-splinebasis functions [7]. Poisson vector graphics extends the DC framework by adding two new geometric primitives, namely Poissoncurves and Poisson regions. The former is to model color discontinuity across curves, while the latter is to designsmooth shading within the user specified regions. Mathematically speaking, PVG solves a Poisson’s equationwith piecewise constant Laplacians f . As the first order Laplacian, PVG takes DCI as a special case with f ≡ f brings three unique advantages. First, users can3a) Poisson curve (b) f + = 41 = − f − (c) f + = 41 , f − = − f + = 19 (e) f + = 82 (f) Spatially varying f Figure 3: Poisson curves are used to model color discontinuity in a bounded region. (a)-(b): A diffusion curveis used to create the beak of the Rubber Duck. (c)-(d): We can create a sharp edge using a Poisson curve γ (dashed line). Increasing the Laplacian constraint | f | makes a stronger edge. (f) We can also use spatially varyingconstraint to define sharp edges with varying strength.explicitly control the local and/or global shading profiling via manipulating f (which is a scalar for each colorchannel). Second, users can easily control the extrema, which are either on the curves (for PC and DC) or insidea region (for PR). Third, PVG allows intersection among the geometric primitives.Although a PVG can have an arbitrary number of PCs and PRs, it must contain at least one diffusion curve,serving as the boundary condition g . In the following, we detail Poisson curves and Poisson regions. Similar to diffusion curves, a Poisson curve γ is two-sided, denoted by γ + and γ − , and can be either open orclosed. We associate each side a Laplacian value, denoted by f + and f − respectively, such that f + + f − = 0 (seeFigure 2). The requirement for zero sum is for local shading control. To explain this, consider a region D ⊃ γ that bounds the diffusion of γ . The divergence theorem (cid:82)(cid:82) D ∆ udA = (cid:72) ∂D ∇ u · n dl relates the double integralof ∆ u to the line integral of ∇ u . Since the color function u remains unchanged on ∂D , the line integral of ∇ u is a constant, implying that the double integral of Laplacian is also a constant. Based on this observation, weset (∆ u ) | γ + + (∆ u ) | γ − = 0 (see Figure 2). Although the zero-sum is only a necessary condition to ensure localshading control, it works pretty well in our experiments.Note that the zero-sum condition is hidden to users, who simply drag over a slider to specify f + . As long as f + (cid:54) = 0, the Poisson curve corresponds to a sharp edge. The larger the value | f + | , the stronger the sharp feature.Since we model Poisson curves as cubic splines, users can also specify spatially varying constraints (∆ u ) | γ bysetting weights on the control points. See Figure 3. We develop Poisson regions to produce photorealistic effects, such as specular highlights, core shadows, translu-cency and halos. Observe that the Laplacian of specular highlight is a “bell” shaped curve (see Figure 6). Todiscretize such a function, we decompose a Poisson region into two disjoint sub-regions D and D , where theouter part D is relatively thin so that it preserves the geometry of ∂D well. We assign strictly monotonicconstraints f i to D i , i = 1 ,
2. Similar to Poisson curves, we also require a vanishing sum (cid:80) i =1 (cid:82)(cid:82) D i f i dA = 0 forlocal shading control. As Figure 6 shows, f i s with decreasing values form a U -shaped curve, which simulate theLaplacian of specular reflection, while f i s with increasing values are bell-shaped, which simulate the Laplacian ofcore shadows. To simulate halo, we also provide additional control that offsets f i s (see Figure 6).To determine the the sub-regions D and D , we take the boundary ∂D as the source and compute theEuclidean distance transform. Let d max be the maximal distance to the boundary. We then define D = { x | d ( x ) ≤ . d max , x ∈ D } and D = D \ D (see Figure 6(a)). To produce halos in a Poisson region, we alsoallow user to add an increment δ i to f i (see Figure 5).There are 2 differences between PC and PR: First, a PC is a double-sided curve, which can be either openor closed, and a PR is region whose boundary is closed. Second, PC is mainly designed for modeling colordiscontinuity, whereas PR is to produce smooth shadings, such as specular highlights and core shadows (seeFigure 4). 4C DC+PRFigure 4: Poisson regions (loops with hatches) can simulate smooth shading effects, such as specular highlightsand core shadows, which are usually difficult to obtain using DCs only.(a) (b) (c) (d)Figure 5: We can produce halos in a Poisson region by adding each Laplacian constraint f i an increment δ i , where f i + δ i , i = 1 , ,
3, are strictly monotonic. (a) There are two Poisson regions (loops with hatches) in this PVG. (b)Rendering without PR, i.e., f i = 0, δ i = 0. (c) Rendering without increments, i.e., f i (cid:54) = 0, δ i = 0. (d) Renderingwith increments i.e., f i (cid:54) = 0, δ i (cid:54) = 0. PVG has three unique features which are favorable for authoring.
Local shading control.
Although both PCs and DCs are able to produce color discontinuity across thecurves, they are fundamentally different. Using DCs, users explicitly specify the boundary condition (i.e., colors)on both sides of a curve. To change tone either locally or globally, users have to re-assign the colors for all thecurves involved, which is tedious and non-intuitive. In contrast, PVG separates colors and tones in that theboundary condition of PC (i.e., Laplacian of colors) is a relative value and the color of a PC is determined by theDC enclosing it. As a result, changing tone does not require any modification of the boundary condition of PCs.See Figure 16 for an example. Poisson regions also enable local control, since the area integral of the Laplacianon a PR is zero.
Ease of extrema control.
Diffusion curves produce harmonic color functions, whose extrema are alwayson the boundaries. Unfortunately, such a nice property is not available to biharmonic functions. As pointed outin [5][12], it is difficult to control the locations of extrema in the TPS based vector graphics [8]. Since PVG isnot a harmonic function, it also contains extrema points. However, users can control the locations of extremumin an easy and direct manner. Observe that non-zero Laplacians are assigned to the points on DCs and PCs, andthe points inside PRs. Therefore, the extrema of a DC or PC are precisely on the curve, and the extrema of aPR P are guaranteed to be inside P . See Section 6 for more discussions. Permit of intersection among geometric primitives.
In the DCI framework, diffusion curves are not al-lowed to intersect, since the colors associated to the intersecting curves compete with each other (see Figure 12(a)).Hence, users have to split those curves into disjoint segments with different colors. This extra operation becomesa serious drawback to designers, who have to deal with a large amount of short segments and their constraints. Incontrast, all types of primitives can intersect each other except for two DCs. This feature not only simplifies thedrawing process, but also allows users to use layers, which is a powerful technique for making complex drawing.5a) (b) cos θ (c) ∆ cos θ (d) (e) (f)Figure 6: (a) A shiny sphere rendered using the Phong illumination model. (b) The specular highlight is cos k θ ,where θ is the angle between the viewing vector and the reflection vector, and the exponent k is the shininessconstant. (c) The Laplacian of cos k θ is U -shaped. (d) A Poisson region R consists of two disjoint sub-regions D = D ∪ D , each of which is associated with a Laplacian constraint f i . (e) The strictly decreasing f i s are toapproximate the U -curve of ∆ cos k θ , simulating specular highlights. (f) Similarly, the strictly increasing f i s areto model the Laplacian of core shadows. To solve Equation (1), we need Green’s third identity, u ( x ) = (cid:90) (cid:90) Ω G ( x, y )∆ u ( y ) dσ y + (cid:73) ∂ Ω (cid:18) u ( y ) ∂G ( x, y ) ∂ n − G ( x, y ) ∂u ( y ) ∂ n (cid:19) dl y , (2)where dσ and dl are the surface and line elements, n is the outward pointing unit normal of dl , G ( x, y ) is Green’sfunction of the Laplace operator, i.e., ∆ G ( x, y ) = δ ( x − y ). To simplify the discussion, we assume the domain Ωis simply connected. However, the framework can be trivially extended to multiply connected domains in whichGreen’s identity still hold.The first term is a double integral, which is computationally expensive due to its global nature. To improvethe performance, we discretize the domain using a quad-tree and then decompose the area integral into a sum ofline integral over each sub-domain. After reorganizing the terms, we show that the solution u ( x ) can be writtenas a weighted sum of a set of locally-defined functions, called harmonic B-spline basis functions. The weights arethe control points of the spline, and are computed by solving a small sparse linear system. In the following, wedetail the solver using a toy model shown in Figure 7. Discretizing Domain.
Given a user-specified resolution, we discretize the domain Ω using a quad-treeso that each pixel p j ∈ ∂ Ω i is in a square, denoted by R j . All squares except those containing pixels of ∂ Ω i are completely inside some subregion. Then we have Ω = ∪ ni =1 R i , where n be the total number of suchsquares. Let us denote A i the area of the square R i . We then define two disjoint sets, the boundary subset B = { R i | R i ∩ ∂ Ω (cid:54) = ∅ , ≤ i ≤ n } and the interior subset I = { R i | R i ∩ ∂ Ω = ∅ , ≤ i ≤ n } . See Figure 7(c). Decomposing Double Integral.
For each square R j , f | R j is a constant, since R j is either completely insidea subregion or a square containing only one boundary pixel of a subregion. So we can rewrite the first term ofEqn. (2) as (cid:90) (cid:90) Ω G ( x, y )∆ u ( y ) dσ y = n (cid:88) j =1 (cid:90) (cid:90) R j G ( x, y )∆ u ( y ) dσ y = n (cid:88) j =1 (cid:82)(cid:82) R j G ( x, y ) dσ y A j (cid:90) (cid:90) R j ∆ u ( y ) dσ y = n (cid:88) j =1 G R j ( x ) (cid:73) ∂R j ∂u ( y ) ∂ n dl y , (3)where the last equation comes from the divergence theorem and G R j ( x ) (cid:44) A j (cid:82)(cid:82) R j G ( x, y ) dσ y is the average valueof Green’s function in region R j . Note that the boundary ∂ Ω i of a sub-region Ω i may not be part of the geometric boundary ∂ Ω. g (b) f (c) Quad-tree (d) Voronoi diagram (e) u Figure 7: Illustration of our Poisson solver. (a) shows the domain Ω and the boundary condition g whose valuesare encoded in color. (b) shows the piecewise constant function f that partitions Ω into three disjoint sub-regionsΩ = ∪ i =1 Ω i . (c) We discretize Ω i using a quad-tree, and organize its leaves into interior nodes (yellow), boundarynodes (blue) and exterior nodes (red). Let n be the total number of interior and boundary nodes. (d) Weconstruct a Voronoi diagram using the interior and boundary nodes as the generators, and clip the diagram with ∂ Ω. For a Voronoi cell V i , we define a harmonic B-spline basis function ψ i ( x ), whose knot is the generator of V i .To properly evaluate the spline on the boundary, we also need the squares containing the exterior nodes (the reddots in the close-up view) that are adjacent to the boundary Voronoi cells. (e) For a boundary Voronoi cell V i ,we simply set its control point λ i using the given boundary condition g . For internal Voronoi cells, we computetheir control points by solving a sparse linear system of size k × k , where k is significantly less than the numberof pixels in Ω. Finally, the solution is given by u ( x ) = (cid:80) ni =1 λ i ψ i ( x ).Consider a square R j ∈ B . Observe that ∂R j ∩ ∂ Ω is one pixel, which is sufficiently small. So the line integralcan be approximated by (cid:82) ∂R j ∩ ∂ Ω G ( x, y ) ∂u ( y ) ∂ n dl y ≈ G R j ( x ) (cid:82) ∂R j ∩ ∂ Ω ∂u ( y ) ∂ n dl y , (cid:82) ∂R j ∩ ∂ Ω u ( y ) ∂G ( x,y ) ∂ n dl y ≈ u ( R j ) (cid:82) ∂R j ∩ ∂ Ω ∂G ( x,y ) ∂ n dl y , where u ( R i ) is the average color in R i . We get (cid:73) ∂ Ω G ( x, y ) ∂u ( y ) ∂ n ≈ (cid:88) R j ∈B G R j ( x ) (cid:90) ∂R j ∩ ∂ Ω ∂u ( y ) ∂ n dl y (4) (cid:73) ∂ Ω u ( y ) ∂G ( x, y ) ∂ n ≈ (cid:88) R j ∈B u ( R j ) (cid:90) ∂R j ∩ ∂ Ω ∂G ( x, y ) ∂ n dl y (5)Referring to Figure 7(c), we classify the shared edges between two adjacent quad-tree cells into three groups: interior edge : an edge shared by two interior (yellow) cells; inner boundary : an edge shared by an interior (yellow)cell and a boundary (blue) cell, or two boundary cells; outer boundary : an edge shared by an exterior (red) celland a boundary (blue) cell.Substituting Equations (3),(4) and (5) into (2) yields u ( x ) ≈ (cid:88) R j ∈B u ( R j ) (cid:90) ∂R j ∩ ∂ Ω ∂G ( x, y ) ∂ n dl y + n (cid:88) j =1 G R j ( x ) (cid:73) ∂R j ∂u ( y ) ∂ n dl y − (cid:88) R j ∈B G R j ( x ) (cid:90) ∂R j ∩ ∂ Ω ∂u ( y ) ∂ n dl y = n (cid:88) j =1 G R j ( x ) (cid:90) ∂R j \ ∂ Ω ∂u ( y ) ∂ n dl y + (cid:88) R j ∈B u ( R j ) (cid:90) ∂R j ∩ ∂ Ω ∂G ( x, y ) ∂ n dl y = (cid:88) R j ∈B G R j ( x ) (cid:90) ∂R j \ ∂ Ω ∂u ( y ) ∂ n dl y + (cid:88) R j ∈I G R j ( x ) (cid:90) (cid:90) R j ∆ u ( y ) dσ y + (cid:88) R j ∈B u ( R j ) (cid:90) ∂R j ∩ ∂ Ω ∂G ( x, y ) ∂ n dl y = (cid:88) R j ∈I A j f | R j G R j ( x ) (cid:124) (cid:123)(cid:122) (cid:125) internal cells + (cid:88) R j ∈B G R j ( x ) (cid:90) ∂R j \ ∂ Ω ∂u ( y ) ∂ n dl y (cid:124) (cid:123)(cid:122) (cid:125) inner boundaries + (cid:88) R j ∈B u ( R j ) (cid:90) ∂R j ∩ ∂ Ω ∂G ( x, y ) ∂ n dl y (cid:124) (cid:123)(cid:122) (cid:125) outer boundaries (6)7e denote by e ij the common edge between two adjacent squares R i and R j . Define u i (cid:44) A i (cid:82)(cid:82) R i u ( x ) dA theaverage of u ( x ) in square R i . Now we discretize the sum of line integrals G R i ( x ) (cid:90) e ij ∂u ( y ) ∂ n ij dl y + G R j ( x ) (cid:90) e ij ∂u ( y ) ∂ n ji dl y ≈ a ij ( u j − u i ) G R i ( x ) + a ij ( u i − u j ) G R j ( x )= a ij ( G R j ( x ) − G R i ( x )) u i + a ij ( G R i ( x ) − G R j ( x )) u j ≈ u ( R i ) (cid:90) e ij ∂G ( x, y ) ∂ n ij dl y + u ( R j ) (cid:90) e ij ∂G ( x, y ) ∂ n ji dl y (7)where the coefficients a ij is the ratio of the length (cid:107) e ij (cid:107) to the distance between the centers of R i and R j . Thisimplies the inner boundary and outer boundary terms in Eqn. (6) are interchangeable in the discrete sense. Forming Basis Functions.
Denote by N ( R j ) the set of 1-ring neighbors of R j . The sum (cid:80) R i ∈N ( R j ) a ij (cid:0) G R i ( x ) − G R j ( x ) (cid:1) has a form similar to the basis functions of a harmonic B-spline [7], motivatingus to explore the connection between Eqn. (6) and harmonic B-splines. Note that a ij (cid:0) G R i ( x ) − G R j ( x ) (cid:1) is a poorapproximation of the normal derivative across the common edge e ij , since R i and R j may have different sizes,hereby the line between their centers is not perpendicular to e ij and it does not bisect e ij either. To obtain ahigh-quality discretization, we construct a Voronoi diagram using the interior and boundary nodes as generatorsand clip it with the boundary ∂ Ω.Denote by ˆ e ij the Voronoi edge of two neighboring Voronoi cells V i and V j . Then we compute the coefficientˆ a ij as the ratio of the length of Voronoi edge (cid:107) ˆ e ij (cid:107) to the distance between the two generators. Finally, we definethe basis function for Voronoi cell V j as ψ j ( x ) = (cid:88) V i ∈N ( V j ) ˆ a ij (cid:0) G V i ( x ) − G V j ( x ) (cid:1) . (8)The functions { ψ j } nj =1 are the basis functions of a harmonic B-spline, each of which is defined on a Voronoicell. However, the line integrals in Equation (6) are defined on rectangular areas R j . Observe that there is aone-to-one correspondence between the Voronoi cells { V j } nj =1 and the squares { R j } nj =1 , and G V j ( x ) ≈ G R j ( x ),since G is the average. Therefore, we can bridge the gap by adopting an alternative definition of ψ j as follows: ψ j ( x ) = (cid:88) R i ∈N ( R j ) ˆ a ij (cid:0) G R i ( x ) − G R j ( x ) (cid:1) . (9)Similar to the quad-tree edges, we classify the Voronoi edges into three disjoint sets, inner boundaries E ib ,outer boundaries E ob and interior edges E ie . Since each boundary Voronoi cell is a quad-tree cell (see Figure 7(d)),an inner (resp. outer) Voronoi boundary edge is also an inner (resp. outer) quad-tree boundary edge.
Computing Control Points.
Our goal is to express the solution u ( x ) using a harmonic B-spline, i.e., u ( x ) = n (cid:88) j =1 λ j ψ j ( x ) , (10)where λ j is the control point.As Equation 9) shows, each basic function ψ j ( x ) is computed by finite difference of Green’s functions alongVoronoi edges . Therefore, we re-organize (cid:80) j λ j ψ j ( x ) into the three terms in Equation (6) by summing over8oronoi edges , u ( x ) = (cid:88) e ij ∈E ib ∪E ie (cid:0) ˆ a ij ( G R j − G R i ) λ i + ˆ a ij ( G R i − G R j ) λ j (cid:1) + (cid:88) e ij ∈E ob ˆ a ij ( G R i − G R j ) λ j = (cid:88) e ij ∈E ib ∪E ie (cid:0) ˆ a ij ( λ j − λ i ) G R i + ˆ a ij ( λ i − λ j ) G R j (cid:1) + (cid:88) e ij ∈E ob ˆ a ij ( G R i − G R j ) λ j = (cid:88) R j ∈I G R j (cid:88) R i ∈N ( R j ) ˆ a ij ( λ i − λ j ) + (cid:88) R j ∈B G R j (cid:88) e ij ∈E ib ˆ a ij ( λ i − λ j ) + (cid:88) R j ∈B λ j (cid:88) e ij ∈E ob ˆ a ij ( G R i − G R j ) . (11)For a boundary square R j ∈ B , we simply set λ j = g | R j . To compute the control points λ j for internal cells, wesolve the following linear system. Observe that for an internal square R j ∈ I , the coefficient A j f | R j is a constant.Define a Laplacian matrix L ∈ R |I|×|I∪B| , where L ii = (cid:80) j ˆ a ij and L ij = − ˆ a ij for i (cid:54) = j . We then partition L intoblock matrices L = [ L I | L B ], where L I ∈ R |I|×|I| and L B ∈ R |I|×|B| . We also define vectors λ I ∈ R |I| , λ B ∈ R |B| ,and b ∈ R |I| , where λ I is the unknowns, λ B is the given boundary conditions, and b j = A j f | R j . Then we solvethe following linear system L I λ I = b − L B λ B . (12)Since the matrix L I is symmetric and positive definite, the linear system can be solved efficiently using Choleskydecomposition. Remark.
Although Equation (12) is designed to match the first term of Equation (11) and the first term ofEquation (6), we show that with the computed control points λ , the other two terms also match. Observe thatEquation (12) is indeed Equation (1) discretized at the quad-tree nodes. implying that for an internal cell R j ,the control point λ j ≈ u ( R j ). Also note that the coefficients ˆ a ij are the weights of the discrete Laplace-Beltramioperator. Given an interior boundary edge e ij ∈ E ib , we can verify thatˆ a ij ( λ i − λ j ) = ˆ a ij ( u ( R i ) − u ( R j )) = (cid:90) ∂R j ∩ ∂R i ∂u∂ n . Similarly, for an outer boundary edge e ij ∈ E ob , we haveˆ a ij ( G R i − G R j ) = (cid:90) ∂R j ∩ ∂R i ∂G∂ n . Therefore, the second and third terms of Equation (11) match those of Equation (6).
Given a set of PVG primitives in a domain D and the user-specified resolution l × m , we first discretize D into an l -by- m image I . Then we partition D into a set of disjoint sub-domains D = ∪ i D i , where each D i is bordered bya closed, double-sided diffusion curve. Since color diffusion cannot exceed the boundary ∂D i of each sub-domain D i , we can render them in parallel. For each D i , we rasterize the PVG primitives and their constraints that areinside D i . After discretizing a Poisson region, we apply the flood-fill algorithm to fill in the region.Next we construct a quad-tree to partition D i . We split a cell c of the quad-tree is further split if the Laplacianconstraint in c is not a constant, it contains pixels on ∂D i , or it is on the image boundary. The last two conditionsare to ensure the leaf nodes are able to accurately capture the geometry of boundary ∂D i .Taking the leaf nodes of the quad-tree as the generators, we compute a Voronoi diagram { V j } . For eachVoronoi cell, we construct a harmonic B-spline basis function ψ j and compute its control point λ j by solving thesparse linear system in Eqn. (12). Note that the dimension of the linear system is equal to the number of leafnodes of the quad-tree, which is significantly smaller than the number of pixels in D i .9 lgorithm 1 Rendering PVG image
Require:
A set of PVG primitives in a domain D and their constraints (color or Laplacian of color); l × m :image resolution Ensure:
PVG imageDiscretize the domain D into an l -by- m image I and partition D into a set of disjoint sub-domains, D = ∪ i D i ,where each D i is bordered by a closed diffusion curve for each sub-domain D i do Rasterize the PVG primitives and their constraints and partition D i using a quad-treeConstruct the Voronoi diagram using the leaf nodes of the quad-treeConstruct the harmonic B-spline basis function { ψ j } Compute the control points { λ j } for every pixel x ∈ D i do I ( x ) = (cid:80) j λ j ψ j ( x ) end forend for (a) (b) (c) (d)Figure 8: Location ambiguity and zooming-in. (a) In the low resolution image, the pixel p is on the right sideof the curve. (b) In the high resolution image, the sub-pixel p (cid:48) of p , is indeed on the left side. (c) Zigzaggedboundaries occur if one doesn’t address the issue of location ambiguity. (d) Find a pixel q in the image of theoriginal resolution so that q is closest to p (cid:48) and it is on the same side as p (cid:48) . Move p (cid:48) to q and set u ( p (cid:48) ) by u ( q ).Then we smooth the color for the pixels near the boundary using Jacobi iterations [Jeschke et al. 2009].Finally, we evaluate the color for a pixel x ∈ D i using the harmonic B-spline I ( x ) = (cid:80) j λ j ψ j ( x ). Since thebasis functions { ψ j } are localized, the summation applies to x ’s local neighbors N ( x ) only.PVG can handle anti-aliasing easily. Recall that diffusion curves and Poisson curves are double sided. Foreach pixel on a diffusion curve, we simply set its color using the boundary condition g . For each Poisson curve, weadopt the standard curve-drawing algorithm to re-draw both sides of the PC. Due to “soft” boundaries, Poissonregions do not have aliasing issue. As a kind of vector graphics, PVG is resolution independent and naturally supports zooming-in of arbitraryresolution. Consider an arbitrary rectangular region Ω (cid:48) ⊂ Ω. Obviously, it is time consuming to re-discretizethe sub-domain Ω (cid:48) using a quad-tree of higher resolution and then construct a new harmonic B-spline. Instead,we simply keep the quad-tree, the Voronoi diagram and the harmonic B-spline constructed from the originaldomain Ω. For each interior point p ∈ I , we can directly evaluate its color using Eqn. (10). As Figure 8(a)-(c)shows, the tricky part comes from the boundary Voronoi cells B , due to location ambiguity. We fix the problem byresolution-aware point location and Jacobi iteration-based smoothing (see Figure 8(d)). Note that our zooming-inalgorithm neither increases the resolution of the quad-tree nor recomputes the Voronoi diagram. Therefore, it isboth time and space more efficient than na¨ıvely applying Algorithm 1 to a high resolution image. Computationalresults show that the performance of the zooming-in algorithm is independent of the zoom factor. See Figure 9for an example. We implemented our PVG solver in C++ and CUDA7.5, and tested it on a PC with an Intel Xeon E5-2609v2 2.50GHz and an Nvidia Quadro K5000 GPU. Given a PVG with user-specified resolution, we first discretizethe geometric primitives (represented by spline curves) and partition the image domain into disjoint regions. Thenwe run our solver in parallel on each individual region. As Table 1 reports, our solver is efficient and can rendermost testing PVGs in less than 1 second. Since the harmonic B-spline based solver provides an approximatesolution, we evaluated its accuracy by comparing to the standard finite element method, which solves a large10 × × × Figure 9: Our closed-form solver supports random access evaluation, resolution-independent zoom-in and anti-aliasing. Our solver Finite element method Error mapFigure 10: Accuracy. Although our solution is approximate, the relative mean error is only 0.301%, which isequivalent to 0.77 in the scale of 255 as in the 24-bit color model. Such small differences are indistinguishable bynaked eyes.sparse linear system, whose dimension is the total number of pixels in the image. We observe that our solver isaccurate, producing relative mean errors no more than 0.3%. As Figure 10 shows, our solver produces PVG imageswith no visual difference from those of the exact solver, but it runs much faster. The weights ˆ a ii are always positiveand the Laplacian matrix is positive definite and diagonally dominant, implying that the condition number of L is low. Therefore, solving the linear system (12) is numerically stable.Figure 11 demonstrates that PVG is able to express both cartoon-like images and photorealistic images.Poisson curves, as a double-sided curve with opposite Laplacian constraint, create high contrast (i.e., colordiscontinuity) across the curve, which is desired to model object boundaries and sharp features. Poisson regions,on the other hand, have controllable “soft” boundaries, are effective to produce highlights, core shadows, halosand transparency. In addition, we allow PRs intersecting each other and other types of primitives, providing moreflexibility and expressive power to mimic complex shadings in photorealistic images.We conducted a preliminary user study to explore benefits (efficiency and usability) of PVG and compared itwith TPS based vector graphics developed by Finch et al. [8]. We recruited 12 participants who are professional2D artists with 9.3 years painting experience on average. Before going to the tasks in the experiments, weintroduced the key concepts of DC, PR, PC and TPS to the participants, and gave them 20 minutes to familiarizeboth software. After that, they were asked to complete two painting tasks. To help the participants complete thetasks, we showed them the expected results.We designed two tasks to evaluate local shading control and permit of intersection among geometric primitivesin the user study. In experiment discrete colors. Also, it is non-intuitive to explicitly specifying colors for shaded objects with spatially-varyingcolors but the same tone As Figure 14(c) shows, PVG reduces roughly 75% of drawing time as compared to DCand TPS.In experiment N dc , N pc , N pr , N s : the number of diffusion curves, Poisson curves, Poisson regions andsub-domains, respectively; T d , T s : time for domain discretization and our PVG solver; T : the total running time; ε : the relative mean error.Image Resolution N dc N pc N pr N s T d ( s ) T s ( s ) T ( s ) ε Apple 703 ×
603 38 54 16 30 0.148 0.414 0.562 0.301%Bird 512 ×
512 54 16 0 16 0.066 0.227 0.293 0.306%Blood Seeker 765 ×
765 85 71 24 38 0.217 0.93 1.147 0.260%City 512 ×
512 35 76 3 7 0.089 0.438 0.527 0.339 %Dawn 512 ×
512 48 16 1 31 0.064 0.376 0.440 0.162%Duck 512 ×
512 26 1 24 10 0.066 0.306 0.372 0.259 %Egg 512 ×
512 3 0 3 2 0.048 0.169 0.217 0.275 %Light bulb 827 ×
620 8 0 3 31 0.099 0.451 0.550 0.0934%Macau 800 ×
600 45 80 18 51 0.185 0.486 0.671 0.213%Mountains 512 ×
512 15 29 1 1 0.077 0.708 0.785 0.254%Plate 716 ×
492 1 5 0 2 0.069 0.263 0.332 0.267%Rubber Duck 940 ×
622 12 21 11 7 0.149 0.579 0.728 0.164%Snail 512 ×
512 30 20 20 4 0.077 0.463 0.540 0.240%Snow 753 ×
565 34 39 8 30 0.121 0.519 0.640 0.303%Superhero 702 × ×
600 21 0 5 6 0.093 0.332 0.425 0.233%40% of the drawing time as compared to DC and TPS (see Fig. 15(e)).To evaluate the ease of learning, we asked the participants to repeat each experiment 8 times. As the learningcurves in Figures 14(d) and 15(f) show, the PVG curves tend to stabilize in only 3 or 4 trials, whereas the TPScurves take longer, from trial 6 onwards, to become stable. implying that PVG is easier to learn compared toTPS. See the accompanying video for details.The participants commented that PVG faithfully follows the basic painting principle by separating color andtone. In painting theory [23], tones are comprised of highlight, halftone, core shadow, reflected light and castshadow, which are the key factors to produce photorealistic rendering. With PC and PR, they can simulatevarious types of tones and control them in an easy and intuitive manner (e.g, experiment
Color diffusion based vector graphics can be classified according to the order of the PDE. First-order DCs solveLaplace’s equation with Dirichlet boundary condition, while second-order DCs solve the bi-Laplace’s equationwith Neuman boundary condition. Table 2 summarizes the major features of various vector graphics. In thefollowing, we compare PVG with first-order and second-order DCs as well as their variants.
Comparison with diffusion curves.
Since diffusion curve images are harmonic functions, they do notsupport control of color gradient, which, however, is highly desired for producing photorealistic effects. Toovercome this limitation, Orzan et al. [19] blurred the harmonic color function with a spatially varying blurattribute associated to each curve. However, the blurring operation also brings three new problems: First, it doesnot allow explicit control over the value or position of color extrema [8]. See Figure 19 for an example. Second,user cannot directly specifying the blur kernel size. Instead, user specifies a blur attribute for each curve and thekernel size is determined by diffusion those attributes. Third, since the blur attributes are defined on diffusioncurves, one cannot blur the regions which are far away from the curves. Compared with DC, PVG does notrequire any post-processing and users can produce photorealistic effects easily.PVG is also superior in local shading control. If two diffusion curves are close to each other, color diffusion iscontrolled by both curves. Therefore, changing the boundary condition (i.e., colors) of one diffusion curve oftenleads to a chain reaction to the neighboring curves. In contrast, PCs and PRs, constraining the Laplacians ratherthan colors, are loosely coupled with the neighboring diffusion curves. Figure 16 shows an example that userwants to change the hue in a region of interest Ω. For DCI, user has to manually adjust the colors for all DCsinside Ω. With PVG, user only needs to change the color of the boundary DC ∂ Ω, then the Poisson curves insideΩ, still with the same Laplacian f , produce colors that are coherent with the boundary color.Another limitation of DC is that it does not allow intersecting curves, since the colors associated to themcompete with each other. In contrast, PVG allows all types of primitives except for two DCs intersecting eachother. This feature enables the PVG users to create layers and provides them more flexibility in the design13a) Thin-plate splines (b) PVG(c) Time (d) Learning curveFigure 14: Experiment Comparison with constrained diffusion curves.
Bezerra et al. [2] proposed several techniques, suchas diffusion barriers, diffusion anisotropy, and spatially varying color strength, to control the diffusion process.Their approach is able to diffuse both colors and normal maps, hereby producing interesting non-photorealisticeffects. However, the constrained diffusion has two limitations. First, it is non-intuitive to specify the boundarycondition for normals. Second, normals are only diffused within the user-specified region (which may not be aclosed diffusion curve), some artifacts (such as color discontinuity) on the region boundary may occur. WithPVG, users can directly produce specular reflection using Poisson regions. Since the constraint is the Laplacianof colors, colors on the boundary of a PR are continuous. See Figure 14(c) for an example.
Comparison with thin-plate splines.
Finch et al. [8] showed that the solution to the bi-Laplace’s equation∆ u = 0 provides for gradients that closely mimic smooth shading. They developed 5 types of basic curves, namely,tear, crease, slope, contour and value curves, for controlling color values and directional derivatives. Since thebasic curves, in general, cannot be used alone, users need to combine a few types of curves to produce desiredeffects. Finch et al.’s system consists of more than 50 combinations of the basic curves. Such a large number ofdrawing tools is a double-edged sword. On one hand, it provides users more flexility and advanced controls inthe form of value and gradient constraints; on the other hand, it increases the complexity of the system, hencedeepening the learning curve. As Figure 17 shows, there are 13 types of primitives in a typical TPS image, someof them have very subtle differences and effects. In contrast, PVG provides only three types of primitives, each ofwhich has a clear definition and purpose. A preliminary user study in Section 6 shows that PVG is more intuitiveand easy to use than TPS. Moreover, as pointed out in [12][17], the biharmonic functions can be negative andhave prevalent local extrema, leading to unexpected results (see Fig. 18). As mentioned in Section 3.3, PVGallows users to control the extremum easily, i.e., the extrema are either on DCs and PCs or inside PRs, whichhave non-zero Laplacian. Readers can try the accompanying software to experience PVG. Comparison with generalized diffusion curves.
The generalized diffusion curves [13] spatially blendmultiple conventional DCIs and are able to provide a similar expressive power of color control as TPS. Its solveris also highly efficient and numerically stable. However, since the blending functions are highly non-linear, it isnon-trivial and non-intuitive to design them manually and control the extrema (see Figure 20). Therefore, GDCIis often used in reverse engineering (e.g., image vectorization) and simple editing (e.g., changing the colors ormodifying the curves), rather than authoring.
Comparison with shading curves.
Lieng et al. [17] proposed shading curves to simulate chiaroscurodrawing, providing strong contrasts between light and dark. Users first draw areas of constant tone with curves,fill in each individual area with constant color and specify the influence of that color to adjacent areas. Colorsare then smoothed out with shading profiles, which are associated with each side of the curve. Finally, shadingcurves are converted to 3D control meshes and rendered as Catmull-Clark subdivision surfaces. Shading curvesallow explicit control over color gradients, however, the produced colors are not as vivid as those of DC and PVG(see Fig. 21). Moreover, due to the limitation of their region growing algorithm, shading curves are not able to14a) Thin-plate splines(b) Poisson vector graphics(c) Time (d) Learning curveFigure 15: Experiment R is bounded by a closed diffusioncurve, whose inner side color is dark brown. Row 1 (PVG): we simply changes the boundary color of ∂R to blue,then the Poisson curves inside R (dashed lines in (a) and (c)), still with the same Laplacian constraints, canautomatically adjust to the new boundary condition so that the hue in R are coherent with the boundary color.Rows 2 and 3 (DCI): replacing each Poisson curve to a diffusion curve with proper color conditions (see coloredlines in (e)), one can generate a DCI image (see (h)) similar to the PVG image in (b). However, simply changingthe boundary color of ∂R (see (f)) in the DCI produces strange hue, due to the significant difference between thecolors of the interior DCs and the boundary DC. To fix this, one has to manually adjust the boundary conditionfor each interior DC (see (g)), which is tedious and error prone.Figure 17: Comparison with TPS. Row 1: The TPS [Finch et al. 2011] consists of 53 primitives in 13 categories.Row 2: Our PVG, producing a similar image, contains 51 primitives in only 3 categories: 26 DCs, 1 PCs and 24PRs. 16ed Green BlueFigure 18: First-order vs second-order diffusion. Row 1 shows a TPS with a value curve (the U-shaped curve)and a value-tear curve (the circle). The two curves are close to each other, producing undesired extrema (see theheight functions for the red, green and blue channels), which is on neither curve. Rows 2-4 show one DCI and twoPVGs in which the DCs/PCs/PRs are placed at the same locations. For DCs and PCs, the extrema are exactlyon those curves. For PRs, the extrema are guaranteed to be inside the regions.DCI Red Green BlueFigure 19: Extrema control in DCI. Without blurring (row 1), the extrema are exactly on the diffusion curves,since the points off the curves have zero Laplacians. However, since the two diffusion curves are close to eachother, their color diffusion competes each other. As row 2 shows, the blurring postprocess is helpful to reduce theartifacts. Unfortunately, it also introduces non-zero Laplacians to the nearby regions. As a result, the extremaare not on the diffusion curves (in black) any longer. 17CI 1 DCI 2 Blending function GDCIRed Green BlueFigure 20: Extrema of generalized DCI. Row 1 shows the two DCIs, the blending function and the GDCI (imagecourtesy of S. Jeschke [13]). Row 2 highlights extrema (indicated by the arrows), which are not on the diffusioncurves in either DCI.handle curves with high curvatures and/or intersecting curves. It is also not clear whether shading curves supportzooming-in of arbitrary resolution.PVG Shading curvesFigure 21: The colors produced by shading curves are not as vivid as those of PVG and diffusion curves. Comparison with the existing DC solvers.
Sun et al. [26] developed a boundary element method forrendering diffusion curve textures. Their method is also based on Green’s third identity, and can compute thetexture value of any rectangular region in closed form. As their target is Laplace’s equation, the double integralvanishes, hence they only needed to discretize the line integral in Eqn. (2). Moreover, their method solves a denselinear system to obtain the normal derivatives of colors on diffusion curves. Due to its high computational cost,this step has to be done in a pre-processing stage. Therefore, their method applies to applications with fixedprimitives (such as texture mapping), but it does not work for interactive applications, such as authoring. Ourmethod solves Poisson’s equation and deals with area integrals, which is more challenging than their problem.Moreover, our solver does not require pre-computation. Although we focus on authoring in this paper, our solvercan be trivially extended to texture mapping.The multigrid solvers proposed in [19] and [8] are efficient, however, they are not accurate and may sufferfrom artifacts, such as aliasing and flicking. With robust curve rasterization, Jeschke et al. [14] proposed a GPUbased Jacobi iteration algorithm that can effectively eliminate most of these artifacts. However, this solver does18able 2: Comparison of existing methods.
Method Primitives Color Domain Solver Random Closed Gradient Applicationfunction discretization access form controlOurs DC+PC+PR Non-harmonic Voronoi diagrams Harmonic B-splines Yes Yes Easy Authoring[19] DC Harmonic Hierarchical regular grids Multigrid No No No Vectorization &authoring[14] DC Harmonic Regular grids Jacobi iteration No No No Vectorization &authoring[4] DC Harmonic Regular grids Ray tracing No No No Vectorization &authoring[8] DC variants Biharmonic Hierarchical regular grids Multigrid No No Difficult Authoring[20] DC Harmonic Mesh Mean value coordinates Yes Yes No Vectorization &authoring[5] DC Biharmonic Triangle meshes Finite element method Yes Yes Difficult Authoring[26] DC Harmonic Curved regions Boundary element method Yes Yes No Texture mapping[11] DC Biharmonic Regular grids Boundary element method Yes Yes Difficult Vectorization &authoring[25] DC Harmonic Hierarchical regular grids Boundary element method Yes Yes No Vectorization[28] DC (Bi-)harmonic Curved regions Boundary element method Yes Yes Difficult Vectoirzation[22] DC Harmonic Triangle meshes Ray tracing No No Easy Authoring[17] Shading curves Piecewise polynomials Subdivision surfaces Subdivision No No Easy Authoring[13] Generalized DC Non-harmonic Regular grids Jacobi iteration No No Difficult Vectorization &editing not support random-access evaluation. Moreover, it produces visual artifacts on the image boundary duringzooming-in, since the boundary condition obtained from the low-resolution DCI is not accurate enough to providestable solution for high-resolution DCI. Such artifacts also occur when user pans the camera. Our method doesnot re-assign the boundary conditions, hereby it works well for camera panning and zooming-in.The FEM-based vectorial solver [5] provides closed-form solutions and allows random-access evaluation. Sincethis solver is designed for solving (bi-)Laplacian equations, it is unclear how to extend it for Poisson equations.The BEM-based solvers [26][11][28] can also provide closed form solutions, but they have to pre-compute normalderivatives on control curves, hence they can render DCIs with fixed primitives. The fast multipole method [25]is highly efficient, but it solves only Laplace equations.In contrast to the existing DC solvers, our method solves Poisson’s equation with piecewise constant Laplacians,and it supports random-access evaluation, zooming-in of arbitrary resolution, and anti-aliasing.
Comparison with the quad-tree based Poisson solver [1].
Both our solver and Agarwala’s method adoptthe quad-tree for domain discretization. Their method is highly efficient, but it produces numerical solutions forquad-tree nodes only and adopts linear interpolation for points in a quad-tree cell. Our solver is designed forPoisson equations with piecewise constant Laplacians and it provides closed-form solution for any point in thedomain.
Limitations.
In our current implementation, we adopt the harmonic B-spline based solver, which provides aclosed-form solution. However, the price to pay is that we have to discretize all geometric primitives, even thoughthey are represented using B-splines. Therefore, it is highly desired to develop efficient PVG solver that can workdirectly with continuous boundary conditions.
We presented Poisson vector graphics, an extension of the popular first-order diffusion curves, for generatingsmooth-shaded images. Armed with two new types of primitives, namely Poisson curves and Poisson regions, PVGcan easily produce photorealistic effects such as specular highlights, core shadows, translucency and halos. PVGdistinguishes itself from the existing drawing tools by separating color and tone, which brings three unique features,i.e., local hue change, ease of extrema control, and permit of intersection among geometric primitives. Ourpreliminary user study confirms that PVG is more intuitive and easy to use than diffusion curve and its biharmonicextension. We also developed a harmonic B-spline based PVG solver that supports random access evaluation,zooming-in of arbitrary resolution and anti-aliasing. Although the solution is approximate, computational resultsshow that the relative mean error is less than 0.3%, which is too small to be distinguished by naked eyes.
References [1] A. Agarwala. Efficient gradient-domain compositing using quadtrees.
ACM Trans. Graph. , 26(3):94:1–94:5,2007.[2] H. Bezerra, E. Eisemann, D. DeCarlo, and J. Thollot. Diffusion constraints for vector graphics. In
Proceedingsof NPAR’10 , pages 35–42, 2010.[3] P. Bhat, C. L. Zitnick, M. Cohen, and B. Curless. Gradientshop: A gradient-domain optimization frameworkfor image and video filtering.
ACM Trans. Graph. , 29(2):10:1–10:14, 2010.194] J. C. Bowers, J. Leahey, and R. Wang. A ray tracing approach to diffusion curves. In
Proceedings of EGSR’11 ,pages 1345–1352, 2011.[5] S. Boy´e, P. Barla, and G. Guennebaud. A vectorial solver for free-form vector gradients.
ACM Trans. Graph. ,31(6):173:1–173:9, 2012.[6] Z. Farbman, G. Hoffer, Y. Lipman, D. Cohen-Or, and D. Lischinski. Coordinates for instant image cloning.
ACM Trans. Graph. , 28(3):67:1–67:9, 2009.[7] P. Feng and J. Warren. Discrete bi-Laplacians and biharmonic b-splines.
ACM Trans. Graph. , 31(4):115:1–115:11, 2012.[8] M. Finch, J. Snyder, and H. Hoppe. Freeform vector graphics with controlled thin-plate splines.
ACM Trans.Graph. , 30(6):166:1–166:10, 2011.[9] M. S. Floater. Mean value coordinates.
Comput. Aided Geom. Des. , 20(1):19–27, 2003.[10] R. Hale.
Drawing Lessons from the Great Masters . Watson-Guptill Publications, 1964.[11] P. Ilbery, L. Kendall, C. Concolato, and M. McCosker. Biharmonic diffusion curve images from boundaryelements.
ACM Trans. Graph. , 32(6):219:1–219:12, 2013.[12] A. Jacobson, T. Weinkauf, and O. Sorkine. Smooth shape-aware functions with controlled extrema.
Comput.Graph. Forum , 31(5):1577–1586, 2012.[13] S. Jeschke. Generalized diffusion curves: An improved vector representation for smooth-shaded images.
Computer Graphics Forum , 35(2):71–79, 2016.[14] S. Jeschke, D. Cline, and P. Wonka. A GPU Laplacian solver for diffusion curves and Poisson image editing.
ACM Trans. Graph. , 28(5):116:1–116:8, 2009.[15] S. Jeschke, D. Cline, and P. Wonka. Rendering surface details with diffusion curves.
ACM Trans. Graph. ,28(5):117:1–117:8, 2009.[16] A. Levin, D. Lischinski, and Y. Weiss. Colorization using optimization.
ACM Trans. Graph. , 23(3):689–694,2004.[17] H. Lieng, F. P. Tasse, J. Kosinka, and N. A. Dodgson. Shading curves: Vector-based drawing with explicitgradient control.
Comput. Graph. Forum , 34(6):228–239, 2015.[18] J. McCann and N. S. Pollard. Real-time gradient-domain painting.
ACM Trans. Graph. , 27(3):93:1–93:7,2008.[19] A. Orzan, A. Bousseau, H. Winnem¨oller, P. Barla, J. Thollot, and D. Salesin. Diffusion curves: A vectorrepresentation for smooth-shaded images.
ACM Trans. Graph. , 27(3):92:1–92:8, 2008.[20] W. Pang, J. Qin, M. Cohen, P. Heng, and K. Choi. Fast rendering of diffusion curves with triangles.
IEEEComputer Graphics and Applications , 32(4):68–78, 2012.[21] P. P´erez, M. Gangnet, and A. Blake. Poisson image editing.
ACM Trans. Graph. , 22(3):313–318, 2003.[22] R. Pr´evost, W. Jarosz, and O. Sorkine-Hornung. A vectorial framework for ray traced diffusion curves.
Comput. Graph. Forum , 34(1):253–264, 2015.[23] K. Staiger.
The Oil Painting Course You’ve Always Wanted: Guided Lessons for Beginners and ExperiencedArtists . Watson-Guptill Publications, 2006.[24] J. Sun, J. Jia, C.-K. Tang, and H.-Y. Shum. Poisson matting.
ACM Trans. Graph. , 23(3):315–321, 2004.[25] T. Sun, P. Thamjaroenporn, and C. Zheng. Fast multipole representation of diffusion curves and points.
ACM Trans. Graph. , 33(4):53:1–53:12, 2014.[26] X. Sun, G. Xie, Y. Dong, S. Lin, W. Xu, W. Wang, X. Tong, and B. Guo. Diffusion curve textures forresolution independent texture mapping.
ACM Trans. Graph. , 31(4):74:1–74:9, 2012.[27] K. Takayama, O. Sorkine, A. Nealen, and T. Igarashi. Volumetric modeling with diffusion surfaces.
ACMTrans. Graph. , 29(6):180, 2010.[28] G. Xie, X. Sun, X. Tong, and D. Nowrouzezahrai. Hierarchical diffusion curves for accurate automatic imagevectorization.
ACM Trans. Graph. , 33(6):230:1–230:11, 2014.20o make the paper self-contained, we review some basis properties of harmonic B-splines. For details, we referreaders to [7].Let Ω ⊂ R be a compact domain and T = { t i | t i ∈ Ω } mi =1 a set of knots. Taking { t i } as the generators, weconstruct a Voronoi diagram Ω = (cid:83) mi =1 V i , where V i is the Voronoi cell of knot t i .For arbitrary points x, y ∈ Ω, Green’s function of the Laplace operator ∆ satisfies∆ φ y ( x ) = δ y ( x ) . (13)where δ y ( x ) is the Dirac delta function centered at y . One symmetric solution to Equation (13) is φ y ( x ) = π log( | x − y | ).For a Voronoi cell V j , applying Green’s theorem to (13) yields (cid:90) V j ∆ φ y ( x ) d σ = (cid:90) ∂ V j ∂ ∆ φ y ( x ) ∂ n d s, (14)where n is the outward unit normal to the boundary ∂ V j , d σ and d s are the area and line integral elements,respectively.Then define a function ψ j for each Voronoi cell V j as ψ j ( x ) = (cid:88) i w ij φ t i ( x ) , (15)where w ij is the discrete Laplacian weight and (cid:80) i w ij φ t i ( x ) is a boundary sum that approximates the line integralon the right hand side of Equation (14).Feng and Warren [7] showed that these functions ψ j share many properties of B-spline’s basis functions, hencethey called the linear combination (cid:80) j λ j ψ j , λ j ∈ R d , a harmonicharmonic