EMILIE Gordenker, senior curator of Early Netherlandish, Dutch and Flemish art at the National Gallery of Scotland, is showing me the stars. Sitting in her office overlooking Princes Street Gardens, we are poring over vastly magnified images of a painting of the night sky. The tiny stars were painted almost 400 years ago by Adam Elsheimer, a tailor's son from Frankfurt, who made it as an artist in Rome. He is a painter long known by experts as a key influence on Rubens and Rembrandt, but his name is unfamiliar to the general public.

Now, she tells me, scientist have confirmed that the constellations in Elsheimer's miniature painting, The Flight Into Egypt, are clearly recognisable, his shimmering depiction of the milky way the very first of its type, and the position of the moon so accurate that it can be dated to a particular night: June 16, 1609, a year before Galileo published his groundbreaking research. To make his painting, Elsheimer must have observed the night sky through a telescope. His reputation may have become buried in the past, but in his own time he was a man of the future.

This month Scottish audiences will get their own chance to look at Elsheimer's night sky through a lens. When 31 of his 34 surviving paintings are brought together in Edinburgh for the exhibition, Adam Elsheimer:

Devil in the Detail, every visitor will be given a free magnifying glass, in order to appreciate just how detailed his tiny paintings, most under 30cm by 30cm, really are. The magnifying glass is not just a useful tool, but an apt metaphor. "He didn't leave anything by way of letters or records that tell us his story, " says Gordenker. "That's one of the pleasures of working in a period like this. You have to be a detective."

The man who did the groundbreaking detective work on Elsheimer was also based in Edinburgh: the late Keith Andrews, the keeper of the print room and a remarkable scholar to whom the exhibition, a collaboration among the National Gallery of Scotland, the Stadelsche Kunstinstitut in Frankfurt and the Dulwich Picture Gallery in London, is dedicated. "Andrews's book was so fantastically solid, we're really filling in the detail, " says Gordenker. "It's a testament that, for the most part, what he detected really has stuck."

So what do we know about the artist? Well, while the paintings are well-documented and well-understood, the life is the stuff of romantic legend, and hard to establish. We have reports that he was thought of introverted and melancholy, that he suffered from stomach complaints, exacerbated some sources have claimed, by the gruelling posture necessary when working in miniature. We know that he got into terrible financial trouble, that he spent some time in a debtor's prison and that he died, broke, at the age of just 32, leaving a wife, Carola Stuart, of Scottish descent, and a young son.

In the background there is a row of some kind, a relationship gone wrong with a man called Hendrick Goudt who was both his pupil and a wealthy patron. Some believe it was he who had Elsheimer thrown into jail but, ironically, it may be Goudt who helped save him for posterity. He took five of Elsheimer's paintings back to his home in Utrecht, made engravings of them and thus ensured his influence across northern Europe, where his pioneering interest in nature for its own sake laid the foundations for the golden age of landscape painting.

But if it was in the north where his influence was most keenly felt, it was in the crucible of Rome where his work flourished. "He is part of a very exciting period in Rome, " says Gordenker. "You've got Caravaggio doing some of his major works. Rubens is there, and you've got really lively patrons, dynamic scholars and scientists. It's a really exciting moment. It's New York in the fifties, Paris at the time of Picasso."

That Elsheimer moved in exalted company is certain. One of his lost paintings, that we know of from copies, shows plants he could only have learned about from his friend, the eminent botanist Johann Faber. He clearly knew about astronomy and his fellow painters held him in high esteem. Rubens, in particular, mourned his death. "I have never felt my head more profoundly pierced by grief than at this news, " he wrote.

So why did Elsheimer disappear from the public eye? "You have to remember an artist like Vermeer, who we now all know, also disappeared, " says Gordenker. "What they were waiting for is a champion. There is such a small body of work and they are of small scale; they can get forgotten among larger and splashier works. We want to isolate Elsheimer for this show, let him really chime on his own."