Richard Cosway is now almost forgotten, but in the late 18th century, according to Sotheby's miniatures expert Haydon Williams, "he was like Andy Warhol". Born in 1741, the son of a Devon schoolmaster, Cosway began his career as a jobbing society painter, but by the age of 30 had cornered the immensely lucrative market in the portrait miniature. He became one of the most envied and admired figures in Regency London, a sumptuously dressed dandy and "something of a social lion". William Hazlitt wrote of him: "His miniatures were not fashionable - they were fashion itself." Anyone who was anyone, and quite a few who weren't, beat a path to the diminutive artist's mansion in Pall Mall for a sitting. And from 1785 he became the Prince of Wales's "First Painter" - the only artist ever to have received this title.

"Like Warhol, a social drive was definitely part of Cosway's creativity," says Haydon Williams. "People were desperate to be with him, and his house in Pall Mall could even be likened to the Factory in New York: it symbolised art, fashion and power, all at once. People just had to be seen hanging out there." Some of that desperation can be detected in a description of Pall Mall "blocked with carriages, sedan chairs, linkboys and lacqueys" on evenings when Cosway and his glamorous wife, Maria, held court. Everyone jostled to be part of the Cosways' circle, and even the waspish Horace Walpole was awed by the company he found: not just the English aristocracy but powerful international figures like General Paoli, liberator of Corsica (and lover of Maria Cosway), and Count Oghinski, briefly king of Poland. "I could not help thinking", wrote Walpole after one visit, "how posterity would wish to have been in my situation."

Like Warhol, Cosway was a gossip and a flatterer of the famous, in love with fame itself. He had the same ambiguous sexuality, the same ability to collect people as well as art. And, whereas Warhol mass-produced social icons in vibrant, silkscreened spaces, Cosway mass-produced rococo images of jewelled intimacy and charm (he could manage 12 sittings a day, charging pounds 23 a sitting).

Cosway's star has faded, perhaps because of his lack of large works. Thomas Gainsborough, his Pall Mall neighbour, is remembered in a blue plaque, but not Cosway. The ephemeral nature of the artform he excelled in has worked against his long-term fame. Miniatures are never displayed; they are hidden away. That has always been their nature.

But Cosway will be back in the public eye this year. The latest Merchant- Ivory film, Jefferson in Paris, has Simon Callow (above, with Greta Scacchi as Maria) camping it up as the foppish painter at the height of his powers and the zenith of his influence - in the Paris of 1786, to paint the Duc d'Orleans and act as secret envoy for the Prince of Wales. It also concerns the strange story of Maria Cosway's affair with the then American ambassador and future third president of the US, Thomas Jefferson. This was conducted under Cosway's nose, and apparently with his encouragement.

Whether or not the affair was consummated in those few summer months in Versailles and Paris will probably never be known. The diary of Jefferson's artist friend John Trumbell, on display in Washington, has all the relevant pages describing the romance carefully torn out. Jefferson's (apparently lost) correspondence with Maria Cosway has been described as being amongst the most notable love letters in the English language. The two continued to write to one another till their deaths, with Jefferson also employing Maria's brother, the architect George Hadfield, to assist in the design of Capitol Hill and other Washington buildings.

Maria Hadfield was a highly accomplished musician, and had ambitions to join the premier women painters of the day, like her friend Angelica Kaufman. But Cosway discouraged her efforts, and she threw her talents into becoming one of the great society hostesses of the day - her suitors included Cardinal Flesch, Napoleon's uncle. She was a passionate woman (she once threatened to shoot an opera singer, also her lover, who had not appeared to sing), and a mesmerist who became absorbed in Catholicism. She was made a baroness by the king of Austria in the 1830s for founding a school in northern Italy.

The Cosways were not to stay together. In 1791, Maria became pregnant; General Paoli was supected of being the father, and Jefferson wrote a curt letter to his former lover. But there were other rumours. In an unpublished diary, a friend, Blake George Cumberland, noted that Cosway has "impregnated" his wife against their specific agreement; this constitutes an allegation of rape.

Whatever the circumstances, as soon as the child, a girl, was born, the mother took off back home to Florence. She stayed for four years in Italy, without seeing her husband. Perhaps she had been reminded by her daughter of the bizarre circumstances that surrounded her own infancy. As a baby she had been saved from a nurse who was attempting to kill her - the Beverley Allitt of 1750s Florence - after she had murdered Maria's four siblings. Maria did return to London (which she hated) in 1794, and spent two years with her daughter before the little girl died ("vexing her to death", according to some). Cosway had the little girl mummified and put in a sarcophagus in his rooms, suggesting that, indeed, the child was his. Maria returned for a second time from Italy, to nurse Cosway after several strokes (and "mentally convulsed with the horrors of second sight", it was said) before his death, aged 80, in 1821.