Modelling a Straight Stroke

From a technical point of view, Digital Marbling is a modelling and simulation activity. The modelling is concerned with finding mathematical equations that describe the movement of the colours when a comb or rake is pulled through them. It is then the job of Simulation to develop algorithms that solve those equations and generate the output data that describes the marbled patterns. 

To model the process of marbling exactly would involve the Navier-Stokes equations – a system of partial differential equations that are extremely difficult to solve. Fortunately, we can make several simplifying assumptions, so that the mathematical model we end up with is very simple. The drawback of the simplifications is that we are limited in the types of strokes we can simulate.

The model we end up with simply states that colours move in parallel with the tine, and the distance it moves decreases with distance from the tine. Therefore, colours that are very close to a tine are dragged along further, and colours that are further away move less far. Beyond a certain distance from the tine, the distance moved is less than one pixel,. so we can treat it as zero.

The following diagram shows the geometry we need to do in order to compute how a colour pixel moves. 

digital marbling geometry

We assume that a tine is making a stroke S  in the direction defined by the two points B and E. The unit vector parallel to S is Sp and the normal unit vector is Sn.

The pixel of colour we are interested in moving is at P. It will move to P’ in a direction that is parallel to S. The distance it moves depends on d, the distance between points B and P. The function f (d) takes d as input and gives the distance P-P’ as output. The function f decreases exponentially with d. It also depends on the viscosity of the fluid: the higher the viscosity, the further the influence of the tine extends in direction Sn. This computation must be carried out for all pixels along the vector PB, in principle to infinity in both directions, but in practice only as far as the influence of the tine extends. There are many additional details that we don’t want to go into here.

This is the effect of a single, straight diagonal stroke:

digital marbling diagonal stroke


  1. Alexa S

    Do you have code available for your implementation of digital marbling? I’m very interested in simulating the marbling process for teaching purposes and am trying to find out if there is existing software available to do so.

  2. graham


    Unfortunately not. My marbling program is entirely hand-coded, and I am not aware of any publicly available marbling software.

Submit a Comment