Eikonal
Visual arts system for painting with field theory
I’m currently building an opinionated visual arts instrument using the physics of field theory and so-called elliptic boundary value problems. It is turning into my homage to, and modern take on, impressionism. It’s in active development and pre-release, though an early prototype is open source on GitHub.
Eikonal tries to:
- Automatically enforce coherence by virtue of its imposed grammar
- Balance the abstract and the figurative by combining non-naturalistic rich microstructure with easy insertion of natural motifs
- Be continuous, so that the human can fine-tune and impose their taste in the details (in contrast to AI image gen)
- Be user-friendly by picking a curated-yet-rich set of dials in advance
Eikonal tries to avoid:
- 3D. The 3D graphics space is heavily crowded, so it’s hard to do something new there. Also, it’s hard to avoid it looking computer game-y.
- Being a general computational system, akin to TouchDesigner. Either you can work within a flexible tool and impose your own grammar within the system, or you can impose the grammar directly in the design of the software itself. The latter allows a nicer UX at the cost of flexibility. A paintbrush imposes massive constraints, and that is part of its magic. Total freedom is not helpful when making art, and this is my attempt to define a set of liberating constraints.
Building texture
The most important ingredient of Eikonal is Line Integral Convolution (LIC). LIC is a texture-generation technique used for visualizing flow lines of vector fields. It is conceptually simple. Start with pure noise and a vector field:
Then smear the noise along the flow lines:
The beauty of the technique is that you get to choose any flow, and microstructure follows for free.
Building narrative and flow lines
To get something more interesting you need more interesting motifs. You need a way of building flow lines. One way Eikonal generates flow lines is from imported shapes. We use a physics-inspired technique to map
For example:
In particular, to map shapes to fields we solve a so-called elliptic boundary value problem. It’s basically the type of equation you find in physics that describes the stationary states of extended field-like systems bounded by general walls. Eikonal currently uses the Laplace equation:
It doesn’t matter if you know what this equation is. The point is that this equation describes the electric field generated between metal walls held at fixed voltage (vi). In other words, we are painting with electrostatic fields by authoring with metal walls.
The Laplace equation has a very nice property: long-range correlations. This means that the effect of some local disturbance propagates globally. It is not exponentially damped as you move away from the disturbance. This means that as you insert the shapes that represent your artistic narrative, their shapes will leave a global imprint on the full canvas. It is a sort of “pattern autocomplete.” Insert as many shapes as you want, and the Laplace equation will fill in a smooth flow field in between them.
The open source prototype already contains both these elements, although it is not real-time interactive, since the main computations are happening on the CPU.
Making the system more expressive
One problem I’m currently solving is how to make it more natural to author drama, inhomogeneities, and uneven focus. As Caravaggio will tell you, an interesting piece should not distribute your attention evenly across the canvas. Here is an early image from the Eikonal prototype:
While it has some satisfying qualities, it has no foreground or background. One way I’ve found to address this is to mix the pure noise with real images. This is what I did to create an earlier version of the opening image:
Another approach is to ditch the Laplace equation and extract a vector field from an existing image. For example:
Then we mix the original image with noise and feed it through the smearing process:
On the roadmap
There is much to do. I keep finding rich threads to pull on. The immediate roadmap includes:
- More carefully crafted UX
- Time-dependent images by replacing static noise with cellular automata
- CLI for agents to use the software in collaboration with the user
- Other vector-field-generating methods and elliptic PDEs
- Brushes that interact with the field, like “slinging paint” along the flow lines
- Time-dependent vector fields (tricky, flicker is a big problem)
At kernel length 30 pixels. Runtime scales linearly with kernel length.