rockpaintings.blah.dev

Browser edition v0.1 · engine 0.1.0 · analytical pipeline fully in-browser · optional ML analysis on this site's own server

Rock Art Image Analysis Workbench

Abstract

Painted marks on rock are frequently invisible, or nearly so, in ordinary photographs: pigment fades, substrate colour varies, and illumination is uneven. Their recovery is a problem of colour statistics, not of restoration. This workbench implements the standard analytical methods — decorrelation stretch after Gillespie et al. [1], as established for rock art by Harman's DStretch [2] — together with colour-channel arithmetic, split and blink comparison, and reproducible processing recipes.

Every analytical operation is a deterministic, inspectable transformation of the recorded pixels. Nothing is generated or inpainted; a figure that appears under the stretch was present in the photograph. The analytical pipeline runs entirely in the browser — photographs are decoded, hashed and analysed locally and originals are never modified. One clearly-marked exception: the optional palimpsest tab sends the image to this site's own server for ML inference (processed in memory, not retained), and everything it returns is labelled hypothesis, not evidence.

sourcecomputing stretch…
Figure 1. Synthetic demonstration panel, generated in this tab — not a photograph of any real site. Motifs are painted at 5% opacity into procedurally weathered stone, then recovered live by the engine (CIELAB · covariance · strength 0.90 · max gain 12 · clip 0.5%). Drag the divider.
Open the workbenchworks on your own photographs, or on the panel of Figure 1

1 · Method

Let X be the pixels of the photograph (or of a selected region) expressed in a chosen colour space. From their mean μ and covariance C = VΛVT, the engine constructs a variance-equalising transform and blends it with the identity under a continuous strength α:

T  =  V · diag( si / √(λi + ε) ) · VT
y  =  μ + (x − μ) · ((1 − α) I + α  T)

with an eigenvalue floor ε and a bound on the per-component gain protecting against ill-conditioned statistics. The result is mapped to the display range by percentile clipping. Interactive preview runs on a ≤2.2-megapixel pyramid level; export replays the identical transform matrix over the full-resolution pixels, so preview and derivative are mathematically the same operation, and the matrix itself is preserved in the recipe for reuse across a photographic sequence.

The output is a false-colour analytical image. It is to be read as evidence of colour separation, not as a picture of the panel — which is why the original is kept one held key away at all times.

2 · Capabilities

Global decorrelation stretch
Computed in CIELAB, sRGB, linear RGB or YCbCr from a covariance or correlation matrix, with continuous strength, an eigenvalue floor, a gain ceiling and percentile output mapping. The eigenvalues, component gains, condition number and full transform matrix are displayed alongside the result.
Region-derived statistics
A rectangular region restricts the statistical estimate to the pixels that matter — a painted area, a clean patch of substrate — while the resulting transform is applied to the entire photograph.
Channel arithmetic
Individual channels from Lab, YCbCr, HSV and linear RGB, and a typed expression language over them (R − G, log ratios, chromaticity indices) that is parsed and validated, with divide-by-zero protection and percentile normalisation.
Comparison
The original is always one held key away. A draggable split divider and an alternating blink mode support the visual discrimination that this class of enhancement requires.
Reproducible export
Full-resolution PNG export together with a recipe file recording the source's SHA-256, every parameter, the realised transform matrix and the engine version — sufficient to reproduce the derivative exactly, or to apply the identical transform to another photograph in a sequence.
Palimpsest decomposition (beta)
An interpretive ML engine — trained purely on synthetic panels — proposes figure hypotheses through superimposition: visible-remnant and full-extent (amodal) masks, a condition diagnosis (faded, spalled, rubbed, lichen, occluded, unfinished), an automated Harris superimposition ordering, and diffusion-sampled completions carrying per-pixel uncertainty. Unlike everything above, this opt-in tab sends the photograph to this site's own server; outputs are labelled hypotheses, never evidence.

Planned, following the programme's full requirements document: localised (windowed) decorrelation stretch, PCA and ICA, illumination correction, candidate-pigment probability masks, annotation layers, image registration, collection-scale batch processing, and in-browser (ONNX) palimpsest inference to retire the server exception.

3 · Operating principles

  • Originals are immutable. Every result is a derivative; the source file is read once, hashed, and never written.
  • Every result is reproducible. A derivative without its recipe is an opinion; exports carry the parameters, the realised matrix and the engine version.
  • Enhancement is not reconstruction. No generative model touches the analytical pipeline.
  • Parameters remain inspectable. Presets are named parameter sets and resolve to visible controls.
  • Offline by design. No accounts, no telemetry, no cloud processing.

References

  1. [1]Gillespie, A. R., Kahle, A. B. & Walker, R. E. 1986. Color enhancement of highly correlated images. I. Decorrelation and HSI contrast stretches. Remote Sensing of Environment 20 (3): 209–235.
  2. [2]Harman, J. 2005 (rev. 2008). Using decorrelation stretch to enhance rock art images. Paper presented at the American Rock Art Research Association Annual Meeting. DStretch remains the reference implementation for the discipline. dstretch.com
  3. [3]Le Quellec, J.-L., Duquesnoy, F. & Defrasne, C. 2015. Digital image enhancement with DStretch®: Is complexity always necessary for efficiency? Digital Applications in Archaeology and Cultural Heritage 2 (2–3): 55–67.