During the two years he was creating the patriotic, family-friendly opening ceremony for last summer’s London Olympics, English director Danny Boyle was working on a pair of dark side projects.

“It’s so committee- and meeting-oriented, I knew if we did nothing else the Olympics would drive us insane,” he said by phone from New York City.

In 2010 he took a sabbatical to stage a gory “Frankenstein” at the Royal National Theater. The following year he spent his weekends shooting “Trance,” a labyrinthine neo-noir nail biter about art thieves, hypnotism and a femme fatale that was the outlet for his irreverent, mischievous side.

After organizing squadrons of Mary Poppinses and directing Her Royal Highness in a 007 skit with Daniel Craig, “it was so nice to go to the dark, devious world of ‘Trance,’ I can’t tell you. Like visiting the Olympics’ evil relatives.”

In “Trance,” robber Vincent Cassel uses hypnotherapist Rosario Dawson to uncover the location of a missing $40 million Goya painting from the memory of James McAvoy, a London auction-house executive who has amnesia from a head injury during the heist.

As Boyle put it, the film shuffles “time past, time present, time imagined” like a cagey croupier. There are characters who think they know each other but don’t, and characters who know each other but don’t realize it. The notion of who is using whom becomes exceedingly slippery. Boyle’s goal was to make “nonlinear storytelling exciting.”

“Every film is really an act of hypnotism,” he said. “You’re taking 24 static images and convincing yourself that they move. That was one of the reasons to make the film. The other was that it’s a series of trances you’re witnessing, some of which you’re aware of and some of which you’re not.

“I love movies that keep you guessing, brain movies like ‘Memento’ or ‘Inception’ or ‘Eternal Sunshine of the Spotless Mind.’ But any good movie puts you in a hypnotic state. They manipulate through emotions, score, drama, extreme situations that aren’t really plausible but are realistic enough.”

Boyle says that the part of his job the public doesn’t understand is that “it’s childish. It’s a sophisticated operation technically, but at its core there’s a kind of childish wonder when you go, ‘Believe this.’ You know when you play as a child and you imagine being chased by an army? I’m like that naturally. It’s ludicrous. But when I’m on set I find it a huge advantage. For all the mature, sophisticated analysis we bring to it, actually we’re playacting. I like a kind of innocence even with a thriller like this, which is deliberately manipulative.”

At times, the 56-year-old Academy Award winner seems like a magician with more tricks than he knows what to do with. Perhaps it’s that unfettered exercise of imagination that has led Boyle to dabble in so many different kinds of filmmaking. Highlights on his staggeringly diverse résumé include the sly everything-goes-wrong crime yarn “Shallow Grave”; “Trainspotting,” an ensemble comedy-drama about young drug addicts; the captivating children’s comedy “Millions”; the horrific zombie chiller “28 Days Later”; the Oscar-showered Bollywood romance “Slumdog Millionaire,” and the fact-based desert survival drama “127 Hours.”

Every Boyle film percolates with visual excitement, engaging performances and a cheerful disregard for genre conventions. His theater work is similarly iconoclastic. In his 2010 staging of “Frankenstein,” Benedict Cumberbatch and Jonny Lee Miller traded off playing the monster and his maker. They shared an Olivier Award for best actor.

In “Trance,” the three principal actors are cast cleverly both to and against type. The film opens with a direct address to the audience by the amiable, boyish McAvoy, “who is a good guy,” Boyle said. “He has a voice-over and he’s your guide. He looks to be successful and has a lot of things going for him. And so you think, ‘Yep, this is the reliable narrator.’ Then he begins to shift and distort almost immediately. Vincent Cassel is perfect gangster casting, and at the end he’s like a lovelorn teenager, surprised by the possibility of love late in his life. Then you have Rosario, a highly professional physician who then appears to move into femme fatale behavior, using her allure, her sensuality, to manipulate men. That quality of unpredictability has vanished a bit in films.”

The search for unexplored territory is part of the reason Boyle declined the offer to direct the next James Bond film. “Those movies with a huge budget are not really the way to get the best out of me,” he said. “I like working with restrictions and the challenge of making a film seem like it’s worth more than it actually cost. That’s more fun for everybody, making an evangelical journey together of making something for nothing almost.”

Besides, he noted, “I kind of already made a James Bond movie for the opening ceremonies with a very stellar cast.”