Peter O’Toole died in 2013, and my story begins a good deal earlier than that. I was then curator of the Turner Collection at the Tate, and for some reason was asked to prepare a screenplay for a film about Turner in which O’Toole would star.  I’d never written for the cinema in my life, but was intrigued by the challenge.

Even more of a challenge was the quite evident fact that whatever part he took in the film, O’Toole couldn’t play Turner. The two men were physically as unlike as possible: the actor tall and rangy, the artist stocky and weatherbeaten. So I had to devise a role for O’Toole that would complement Turner and not be outshone by him, though the painter would also have to play a commanding part.

At the same time, it should be a film that brought audiences into close touch with the great artist. My one relevant qualification was that I knew a lot about him, had lived long enough in his company, as it were, to give people a vivid idea of what he was like as a man.

I also took it as a given that my screenplay should be entertaining. There had been several films, mostly for television, about the life and character of Turner, but they were essentially documentary. A notable example was one made to coincide with the big Turner Bicentenary exhibition at the Royal Academy in 1974, in which the artist was played by Leo McKern, which was a memorable pairing.

All this, of course, was long before the recent feature film Mr Turner by Mike Leigh.  I couldn’t expect O’Toole to take part in a mere historical reconstruction, and that wasn’t what I’d been asked for, anyway. I needed to produce some excitement, some action, some drama: a feature film with a plot.

And unbidden there came into my mind a long-standing regret, that Turner’s extraordinary life had never been the subject of a biography by his contemporary in early nineteenth-century London, Charles Dickens. We had been deprived of a great work of literature because nothing like that had emerged, although the two men knew one another slightly. The eccentricity and mystery of the artist’s personal life could almost have been a Dickens invention.

There were plenty of reasons why my screenplay disappeared – as I believe most screenplays do – not least my lack of experience in writing one. So I put the typescript away in a drawer where it languished for many years. When I occasionally thought about it I realised there was some good material there that was going to waste. Eventually I recast it as a novel. That too got pushed to the back of a drawer and forgotten.

One day, a couple of years ago, an occasion arose that, I decided, would justify publishing the book: my retirement after ten years as Chairman of the Turner Society. It came out, courtesy of Amazon, as The Painter’s Boy with the subtitle “An historical caprice”. I hoped that at least a few people would register the reference there to Graham Greene’s novel Brighton Rock, which is subtitled:A Caprice”. Not because my book had anything to do with Greene’s, but because I wanted to hint that there would be literary cross-references in the mix.

Cross-references to Dickens, of course, and you can read the novel for those hidden, or half-hidden, references. Some people have found reflections of other authors too. More simply, you can enjoy it as what I hope is a gripping adventure-cum-love story (with some comedy) set in Victorian London.

The aspect of the idea that has intrigued me most is one that has become very fashionable, but was not so common when I conceived the book: the blending of historical and fictional characters. It was a necessity for me, with my brief to find a role for O’Toole: somebody important in Turner’s life, in a vital aspect to do with neither his life in the Royal Academy nor his very strange and ambiguous family. The dovetailing of fact and fiction is conceptually intriguing. It raises all sorts of questions, both literary and existential.

For instance, the story needed (it was to be a film after all) some love interest. A young couple from Turner’s own circle? Hmm… I found the answer in a pair drawn from both history and fiction, whose adventures lead to a climax intimately involved with Turner’s world, but incapable of consummation outside of the fictitious world I’d created. I’ve been delighted to find readers who haven’t spotted which was which.

I admit I’ve played fast and loose with some of the historical detail, though not, as far as possible, with Turner himself and his immediate surroundings. And Dickens’s London is, I hope, there to be experienced. I haven’t attempted to imitate Dickens’s style – impossible, and wrong. But the great writer himself even makes a brief cameo appearance – something else for the sharp-eyed to spot. I’d like to think that Peter O’Toole might have been tempted to take the role I’d created for him. And which is that?