Wain was an eccentric English artist who may have suffered from schizophrenia, which, some believe is apparent in his paintings. He died in 1939. Cumberbatch will play Wain, while Foy will play his wife, Emily.
Actor-director Will Sharpe (of the BAFTA-nominated British TV series "Flowers"), wrote the script with Simon Stephenson, and will direct. The project is being produced by U.K. banner Showbox Films alongside Cumberbatch's own production company SunnyMarch, with backing from StudioCanal and Film4.
Sharpe also acted alongside Cumberbatch in "Sherlock," as Corporal Lyons in "The Hounds of Baskerville" episode.
Shooting is due to start in August at London's Ealing Studios.
"I am thrilled by the prospect of playing the courageous, playful spirit that is Louis Wain and to be producing such a special film," said Cumberbatch.
"I have admired Will’s work for several years through 'Flowers' and from the moment we first met, knew he was the perfect person to bring Louis’ inspirational and odyssean story to life. Together we plan to bring audiences a sincerely uplifting, playful, thought provoking tale of resilience, creativity and the enduring power of love."
The stars of "Doctor Strange" and "The Crown" previously shared the screen in 2011's "Wreckers."