Even a good inside joke remains an inside joke. “Tamara Drewe,” Posy Simmonds’ loose comic-book take on Thomas Hardy’s “Far from the Madding Crowd,” was very ably and amusingly brought to the screen by Stephen Frears but remained too esoteric for many viewers. The same fate will probably befall Simmonds’ more obvious riff on Flaubert’s “Madame Bovary,” though it’s been sprucely adapted by director Anne Fontaine and her co-writer Pascal Bonitzer and boasts one remarkable performance.

That isn’t the titular one by Gemma Arterton (also the star of “Drewe”), who’s fine but mostly pleasant eye candy as Gemma, a British woman who comes to live in a small town in present-day Normandy. Nor is it that of Jason Flemyng, who plays her rather dim furniture-restorer husband Charlie Bovery, or of Neils Schneider, who’s Herve de Bressigny, the handsome aristocrat with whom she has a torrid affair. All three are characters patterned after the catastrophic romantic triangle in Flaubert’s book, but they’re really secondary to a fourth of Simmonds’ own devising, local baker and Flaubert fan Martin Joubert (Fabrice Luchini), the Boverys’ neighbor who’s not only struck by the similarity in names but becomes convinced that it’s somehow his obsession with the book that causes events in real life to start mimicking those of the novel—a circumstance that he regards with a mixture of fascination and horror.

Though basically an observer, Joubert is actually the driving force in “Gemma Bovery,” and Luchini, who played another character who became enmeshed in tragedy while intruding on relationships from the outside in Francois Ozon’s “In the House” (a better film, actually) gives a performance of moody stares, nervous glances and stunned reactions that tells you everything about his feelings even before his narration kicks in. He provides much, though hardly all, of our perspective on the events that occur within the Bovery household, turning us into voyeurs of the same sort he is even if many of us might never had read Flaubert. And since Luchini is so adept an actor, he actually controls to some extent how we react to the events on screen—and is used to mislead us, as in his concern over rat poison, which might every easily stand in for the fatal arsenic in the novel.

That makes Joubert in many respects the most interesting character in Fontaine’s film. He tells us that he moved Bailleville, near Rouen, some five years earlier after an unsatisfying career in publishing. He took over his father’s baking business, and though he’s expert at the culinary craft, he suffers from his domestic affairs—a nagging chatterbox of a wife, Valerie (Isabelle Candelier) and a dim-bulb son, Julien (Kacey Mottet Klein). His refuge, it appears, is literature, and especially Flaubert’s masterpiece, which he wrote (and set) in the very same area of Normandy. No wonder that when Gemma and Charlie arrive on the scene, it seems like an act of God, or perhaps God’s opposite.

Simmonds, Fontaine and Bonitzer toy with the narrative of the book, of course, but the trajectory is far more straightforwardly observed that it was in “Drewe,” down to the appearance in the final stages of a second lover in the form of Patrick (Mel Raido). It even finds ways to mirror some famous scenes from Flaubert, like that in Rouen cathedral. But it also confounds expectations at other points, leaving us uncertain about how things will go—though from the very beginning we know what the Gemma’s fate will be. But those who are familiar with the novel will certainly get more enjoyment from the film than those who aren’t.

They’re also lively to find it preferable to most of the straight adaptations of “Madame Bovary” that have proliferated over the years, which have included attempts from such illustrious directors as Jean Renoir, Vincente Minnelli and Claude Chabrol. This one may not have cracked the nut perfectly, but at least it’s more imaginative than most, and it certainly has lovely locations and sharp cinematography by Christophe Beaucarne. It also boasts a clever final joke that suggests that Julien Joubert isn’t quite the knucklehead his father takes him for.

But its ace in the hole is Luchini, whom you’re advised to check out not only in “In the House” but in “Bicycling with Moliere,” too.