arXiv:2609.08722cs.GRSep 2026

Manuscript Offprint

arXiv:2609.08722

Inverse Digital Marbling: Recovering Gesture Programs with a Replay Adjoint

Tianqi Liu, Yushan Han, Hang Liu

Abstract

Pigment deposition in paper marbling displaces the pattern already present, coupling the appearance of each gesture to later actions. We recover executable programs for a deposition-based digital marbling model: given a target image, we optimise an ordered program of capsule insertions whose replay approximates it. The capsule primitive continuously joins circular drops to elongated deposits. Its transport is exactly area-preserving and has a closed-form inverse on the exterior of the deposited region. A replay adjoint reconstructs intermediate states, retaining coordinates lost inside deposits and periodic position checkpoints. At 2000 gestures and 1024² pixels, the PyTorch replay implementation uses 8.7× less memory than the tested checkpointed-autograd configuration at comparable step time; the fused implementation fits a program in about four minutes on one workstation GPU. We evaluate image reconstruction on five marbled sheets, compare against transport-disabled fitting, one-pass geometric compensation and a published stroke-based fitter at matched stroke count, and measure sensitivity to an alternative ordered-drop transport. Recovered programs replay across a 4× range of linear resolution. Edits specified in program order or in palette space — inserting a gesture, recolouring a stage, translating a stage — replay correctly under the same model; edits specified by image content, such as moving a motif, do not. On synthetic targets with known generating programs, the recovered programs match the images but not the generating gestures under a positional matching statistic. The output is an editable program in the specified digital medium.

1 Introduction

Turning an image into a program is useful when the program, rather than a raster approximation, is the desired output. It can be replayed at a new resolution, edited at the level of actions, or supplied to an authoring or fabrication system. Stroke-based rendering provides this representation for media in which a placed mark remains fixed: later marks may cover it, but do not change its geometry [1, 4, 5]. That assumption is productive for drawing and painting, but it removes a defining operation

of marbling: the displacement of existing pigment.

In paper marbling, pigment floats on a liquid surface. A new deposit creates paint and displaces the pattern already present; a drawn tool transports earlier pigment along its path. Consequently, the location of an early mark in the final image depends on every later gesture. Gesture order matters, local corrections propagate globally, and a program must be evaluated as a coupled dynamical process. The inverse problem is to recover one program whose execution is visually equivalent to a given sheet, not to identify the historical sequence that produced it.

Two related research directions address complementary aspects of this problem. Digital marbling provides interactive forward simulators and composable closed-form maps [9, 8, 10], most recently analytical fluid brushes whose reverse-drift functions compose in a shader and render at any resolution [23]. These yield ordered programs — but forwards, authored by a user, not recovered from a target; drop insertion is part of that literature, while the tine brushes of Mixwell [23] move pigment without depositing it. Differentiable simulation uses adjoints to recover controls or latent fluid states [21, 22], but optimises continuous fields rather than a discrete, ordered program of typed gestures that each create material. We invert this deposition-based program family.

Fitting requires differentiation through the gesture chain. Retaining every per-pixel intermediate state at N=2000N = 2000 and 102421024^2 requires tens of gigabytes. Checkpointing [13] trades storage for recomputation, while reversible networks [14, 20] and path replay for light transport [12] reconstruct intermediate states. In our renderer, the backward coordinate map is invertible outside each deposit, but its extension across deposited material loses coordinates. The replay adjoint records those exceptional coordinates and regenerates the exterior states.

This paper gives a model of the chain for which that record is small and the rest is cheap, and a system built on it. A gesture is a capsule whose length continuously joins a circular drop to a drawn deposit, and its transport is a translation in parallel-set area coordinates. That gives the forward map and its inverse in closed form, and makes the deposition set the single exact obstruction to coordinate regeneration, with a record count that depends on the sampled trajectories and that we measure directly. What

line of workunknownlater marks move earlier ones?
stroke-based rendering [1, 4, 5] stroke fitting with smudging [15] process recovery from a finished image or time-lapse [24, 25, 26] differentiable fluid control [21, 22]ordered marksno — placed marks are fixed
ordered strokesyes, locally through colour smudging
marks, layers or framesno explicit marbling transport map
forward digital marbling [9, 8, 23] this workcontinuous fields or controlsyes, but there is no typed gesture to recover
nothing — the program is authored ordered typed gesturesyes

Table 1: Related representations and tasks. Forward marbling provides authored programs; inverse painting includes ordered marks, layers, and smudging. Our task fits capsule-deposition programs through an explicit area-preserving exterior transport, with a replay adjoint specialised to its non-injective deposition extension.

the adjoint requires of the operator is a computable inverse; the closed form makes that inverse fast on its whole domain (Sec. 5.2). Geometry, width and palette assignment are then optimised jointly through 2000 gestures.

We evaluate the recovered programs against structural controls chosen to isolate the contribution of transport: a flat-colour floor that puts every error on a common scale, a matched ablation with transport disabled, a one-pass closed-form correction whose geometric obstruction Lemma 1 identifies, a second transport operator built from a published primitive, three seeds, and synthetic targets with known generating programs. Stroke-based renderers fit the same images but optimise a different object — marks that stay where they are placed — so they calibrate raster approximation rather than transport; we run one of them at matched stroke count and report where it wins (Sec. 6.2). The output is an executable program that replays unchanged across a 4× resolution range and can be edited at the level of gestures and stages (Fig. 10): order, replayability and gesture-level structure that survive execution.

References (26)