Eikonal

Visual arts system for painting with field theory

Forgive us II — a dark figure reaching toward a starburst across rippling blue and oxblood lines
Image made by me in Eikonal

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:

Colored random noise used as the input texture for line integral convolution Streamlines showing the analytic vector field used for the example

Then smear the noise along the flow lines:

Line integral convolution of the noise along the vector field

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

Collection of shapes Flow lines

For example:

Two capital E shapes embedded in a line-integral-convolution flow field

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:

2φ =0, φshapei = vi, V =φ

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:

electrogenesis — two figures reaching toward each other through flowing electric field lines

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:

Eikonal interface showing forgive us in progress, with the source image, shape list, and LIC controls visible

Another approach is to ditch the Laplace equation and extract a vector field from an existing image. For example:

Black-and-white photograph of a die balanced on one edge above its shadow

Then we mix the original image with noise and feed it through the smearing process:

The die and its shadow smeared into dense blue, red, and black flow lines

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)
Chicago — dark tree trunks against snowy ground, rendered in blue-black and white field lines
Image made by me in Eikonal
1

At kernel length 30 pixels. Runtime scales linearly with kernel length.