Abstract Art Styles: Mosaic, Brush and Ink

Re-paint one picture three ways: Lloyd-relaxed Voronoi mosaic, contour and curl-noise brush strokes, or pigment diffusing on paper. Click to add seeds, strokes or ink.

Switch to 3D

Presets

Playback

Style

Simulation

Mosaic parameters

Brush parameters

Ink parameters

Layers

Model check

The science

What is modelled

One reference picture (a procedurally drawn landscape) is re-painted by three different mechanisms, each with its own physics or geometry. Nothing here is a neural style transfer; every style is a small, inspectable algorithm.

Equations

  • Mosaic. Seeds si define Voronoi cells (all points nearer to si than to any other seed). Lloyd's algorithm moves every seed to its cell centroid, which lowers the quantisation energy E = Σ w(p) |p − si(p)|² / Σ w at every step. Weights w = 1 + 6a|∇L| put more tesserae where the picture has edges. For equal cells of area A/N the best possible value is the hexagonal lattice E / (A/N) = 5/(18√3) ≈ 0.1604.
  • Strokes. A stroke follows the contour direction t = (−gy, gx)/|g| (perpendicular to the luminance gradient g of a blurred copy of the picture), blended with a curl-noise flow. Curl noise is u = (∂ψ/∂y, −∂ψ/∂x) of a Perlin fractal potential ψ, so ∇·u = 0: the flow has no sources or sinks and strokes never bunch up. Brushes go from large to small (three layers) and a stroke stops when the blurred colour changes by more than the edge tolerance.
  • Ink. Pigment concentration C obeys ∂C/∂t = ∇·(D ∇C) − ∇·(u C) − k C. Paper fibres vary D from cell to cell, u is the curl-noise capillary flow, and the term k C binds ink to the paper (bound ink B gains what C loses, so C+B is conserved). A single drop spreads as a Gaussian with σ²(t) = σ0² + 2Dt and peak Q / (2πσ²). Colour is Beer-Lambert absorption I = Ipaper e−s(C+B) of cyan, magenta and yellow pigment.

Checks run in the page

  • Lloyd relaxation of 200 random seeds: the energy must fall monotonically and end near, but never below, the hexagonal value 0.1604.
  • An isolated ink drop on a fresh grid: measured variance and peak compared with the analytic Gaussian, and the total ink unchanged.
  • The curl-noise field is differentiated with two different step sizes and its divergence compared with the size of its gradient; the whole ink solver (flow, grain, absorption) must conserve total mass to rounding error.

The checks use fixed test setups, not your sliders, so they do not freeze the page; press Re-run checks to repeat them.

Honest simplifications

The reference is synthetic, colours of the ink are a simple subtractive model, not real pigment optics, and the explicit finite-volume ink solver uses a first-order upwind scheme, which adds a little numerical diffusion when the flow is fast. Brush strokes are not a physical bristle simulation. The sim is educational and artistic: it shows the algorithms behind mosaic, painterly and ink effects, not a general style-transfer engine.

What to try

  • Mosaic: set the detail-adaptive density to 0 and watch the cells settle into near-hexagons; raise it and cells crowd along edges.
  • Strokes: set the curl share to 0 (strokes obey contours) then to 1 (strokes obey only the noise flow).
  • Ink: set absorption to 0 and the flow high for marbling; set grain to 1 for feathery edges.
Mosaic energy per Lloyd step
Brush painting: colour error
Ink: bound share and total mass
Mosaic cell area distribution
Made with 🟠 Blender · Three.js