In 2005, at a rock art conference, a man with a PhD in mathematics from Berkeley and a career in medical imaging saw a pair of photos of Mars. One—the familiar rusty plain. The other—a colorful mosaic of red, green, and yellow, where details suddenly emerged. This wasn't a new image, but the same one run through an algorithm JPL invented in 1978. Jon Harman realized this was exactly how to look at the faded paintings of his hobby—and wrote the DStretch plugin, which over the next twenty years uncovered hidden paintings from Angkor Wat to Norwegian fjords.
This story is usually told as a cozy anecdote about how space technology found application on Earth. But the most interesting part is different: the algorithm was published for almost thirty years—and no archaeologist used it. Not because it was secret—but because knowledge doesn't transfer itself from paper to tool. For that, you need a person standing at the intersection of two non-intersecting worlds. And in this, the story transforms from anecdote into diagnosis.
We should start with why enhancement was needed at all. Martian and satellite images are a classic multispectral data problem: the camera captures a scene in several narrow bands, and these channels almost duplicate each other, with correlation between them often above 0.95. Visually, the picture looks "monotonous"—all colors compressed into a narrow corner of the palette, and the eye distinguishes nothing, though the data inside is full of detail.
The physics here is simple: adjacent spectral bands reflect the same surface, so numerically they nearly match. The difference between types of rocks or minerals exists, but is smeared into a tiny difference between channels. This isn't a camera defect, but a property of the data. Classic "contrast enhancement" is powerless here: it stretches channels individually, but doesn't unfold the colors themselves—because what's compressed isn't the brightness, but their mutual relationships.
There's an earthly version of the same trap, and it's much more ancient. Pigment fades, and its color approaches the color of stone. In Harman's 2006 paper on Baja California, this is explained through vision physiology with reference to Livingstone: color and brightness are processed by different mechanisms of the visual system, and human color acuity is much coarser than brightness acuity. As fading progresses, the brightness contrast is created by the stone itself, and the figure dissolves not into darkness, but into noise. Meanwhile, a digital photo preserves the color difference the eye no longer distinguishes—there lies "invisible" information, like redundant color information in a jpeg.
The solution idea emerges from pure statistics. The Karhunen-Loève transform—a relative of PCA—rotates the color space so the axes align along the real directions of data variability, and the channels stop correlating. Then the variances along the new axes are equalized, and the result is rotated back to RGB. If the color compression was "lopsided," after this procedure the entire color cube fills in, and invisible differences become visible.
The idea to apply it to images came from Jim Soha, head of the digital image processing group at JPL. In 1978, together with Allan Schwartz, they published a paper with a long title about "multispectral histogram normalization"—essentially, that very idea. Let's be honest: the Karhunen-Loève transform itself is older, and in 1973 M. M. Taylor already proposed stretching in decorrelated coordinates, but Soha and Schwartz applied it to images and put it into operation. The method caught on in geology: it was used to map lava flows on the Big Island of Hawaii.
The idea was refined into engineering form by his colleague Ronald Alley. He noticed that the original chain of intermediate images accumulated rounding errors, and replaced it with a single 3×3 matrix operation—faster and more precise. For ASTER, a spectrometer launched in 1999 on the Terra satellite and still operating, Alley in 1996 wrote an Algorithm Theoretical Basis Document—an internal JPL document with formulas, pseudocode, and step-by-step specification. Quote from Alley in NASA Spinoff: "Somebody had to write a description of this thing so users would understand what it's about." He had no idea that in ten years his service memo would become the bible for archaeologists.
Now the most curious part: why wasn't this translated into archaeology earlier. The method had no secrecy, no patents, no hardware—just mathematics and a paper in open access. The answer, apparently, is that there are no bridges between communities: archaeologists had no reason to read internal JPL documents, JPL engineers had no reason to think about faded rock paintings. Each sat in their own language, their own journals, and their own conferences.
The second barrier—lack of a tool. Even if someone from archaeology had stumbled upon the idea, applying it bare-handed was impossible: you need competence in linear algebra, matrix operations, covariance matrices. A paper is a recipe, not a ready dish. Bridges between disciplines exist either as translator-people or as ready tools, and both variants are rare.
There's a third barrier easy to miss: the technique required digital photographs, and they only became mainstream in the early 2000s. In the film era, running every frame through a covariance matrix was exotic. So "27 years on the shelf" isn't laziness or stupidity, but a convergence of absent bridges, absent tools, and a just-maturing technological base. Knowledge doesn't transfer itself—you need a person at the intersection of worlds.
Jon Harman is a remarkably suitable carrier. Bachelor's in mathematics from Wisconsin (1972), PhD in mathematics from Berkeley (1980), multi-year career in medical imaging: he designed algorithms for CT manufacturers and ophthalmic devices. That is, a person who knows algebra and is used to turning it into program code—and at the same time, from the 1980s, traveled to field sites as an enthusiastic amateur of rock art.
Here appears the "accident." According to the official NASA Spinoff version, around 2005 at a conference someone showed him Martian pictures "before and after." But in the biography on the Rock Art Research site there's a detail that retellings lose: in November 2004, the idea was suggested to him by Robert Mark—a well-known rock art researcher. Mark and Billo had already published work on digital enhancement of rock art images in 2002. That is, Harman's path was paved not by a random slide glitch, but by a living person who said: "Look, this should work for you too." Then came the conference, the Martian "before/after" pictures, and Harman's reaction: "I googled and found the NASA paper explaining the algorithm. I knew I could do it—and I did."
A beautiful detail at the junction of his worlds: the Karhunen-Loève transform is named after Michel Loève—and Loève was one of Harman's mathematics professors at Berkeley. So the "accidental" meeting of the algorithm with archaeology is actually a student's meeting with his own professor's method, a quarter century later.
The very first test on his photos from Baja California succeeded: in a shot from the San-Borjitas cave, a yellow figure he himself could barely distinguish suddenly "materialized from nowhere." The juiciest detail—that in 1974 Campbell Grant missed the figure, who was drawing a tracing of the entire cave ceiling for his book: the line was in the field of view, but not in perception. In March 2005, Harman showed DStretch at the Society for California Archaeology conference in Sacramento—and the tool immediately went public.
The loudest result—Angkor Wat. Singaporean archaeologist Noel Hidalgo Tan, then a participant in excavations at Angkor, in 2010 during a lunch stroll through the temple noticed traces of red pigment, photographed them, then ran the shots through decorrelation stretch. The result stunned him: about 200 hidden paintings throughout the complex—elephants, lions, Hanuman, boats, a pinpeat musical ensemble, horsemen between two structures. The most detailed scenes in the upper level of the central tower are passed daily by thousands of tourists: they're simply not visible to the eye.
Some are pilgrims' graffiti after the temple's abandonment in the 15th century, but the most complex scenes, apparently, are traces of ancient restorations, possibly from the time of King Ang Chan, who ruled 1528–1566. In 2014, Tan published this in Antiquity—and the discovery made the world press.
Others followed. In Beni Hasan—a Middle Kingdom necropolis in Egypt—Linda Evans and Anna-Latifa Mourad (Macquarie University) in 2018 showed that DStretch pulls from wall paintings images of pigs, bats, and an extremely unusual vulture—animals rarely encountered in Egyptian art. In Norway, at the Årsand 1 site, whose paintings were documented back in 1940, applications in 2008 and 2012 added about 15 unknown figures and clarified details in 28 others. In Writing-on-Stone Provincial Park in Alberta, the algorithm revealed a drawing of a horseman—the "calling card" of a Crow warrior, left to mock Blackfoot enemies: an ancient equivalent of graffiti tagging.
And then the tool went beyond rock art archaeology. In Vlochos (Thessaly, Greece), aerial photos with DStretch processing revealed zones of interest that were missed by terrain models, ground-penetrating radar, and electrical resistance. In 2023, Tübingen and Tennessee published a DStretch protocol for tattoos on mummies. Harman estimates a flow of 200 requests per year at $50—that's thousands of images processed worldwide, and the ImageJ plugin itself he still distributes almost by hand.
It would be too smooth to end on "the tool reveals everything." The story has an honest counterweight: in a Hacker News thread, practitioners with experience try DStretch and decorrelation stretch themselves—and many don't succeed. One tried catching hidden paintings in Angkor with multispectral filters—didn't work. Another built decorrelation stretch into his software—"it works, but the moment of 'wow, I wouldn't have seen this without it!' never happened." This is an important correction: the technique isn't a magic wand, it only raises the signal where it physically exists, and you still need to know where to look.
Meanwhile, the method continues to be refined. A recent review in Mathematics (MDPI, 2025) breaks down weaknesses of the classic scheme and proposes alternative algorithms. The community long ago found simpler workarounds: decomposition into LAB channels with auto-contrast in GIMP or Photoshop gives roughly similar effect, and MATLAB has long had built-in decorrstretch. A telling detail of the era: the same day NASA released the story, someone on Hacker News asked an LLM to assemble a web implementation of the algorithm—and got it in hours, free and in open access. For forty years the method traveled from JPL documents to archaeologists through a person who happened to be at the intersection of two professions; now the path from paper to working prototype takes an evening.
The most valuable thing here isn't "NASA helps archaeologists." The most valuable is the very mechanism of idea transmission. For three decades the method lay in open access and didn't move until a person appeared who simultaneously understood the language of algebra, the language of software, and the language of field archaeology. Such people are rare: they can't be planned with a grant or summoned by a regulator. You can only create conditions where non-intersecting communities intersect: conferences where professions mix, tools that don't require a degree in linear algebra, papers written in human language.
And second: the accident here isn't a lottery ticket, but a bridge someone built in advance. Mark's hint in November 2004, the conference, the Martian pictures—yes, there's an element of lottery. But what worked wasn't the lottery, but the carrier's readiness: Harman could have seen the same pictures five years earlier and not reacted. Three rare factors converged: an idea conveyed by a living person; a carrier with the needed dual competence; and the maturity of digital photography. Remove one of three—and we might still be walking past the hidden elephants of Angkor Wat, not seeing them.