The work of Georges Simenon has always been difficult to adapt for the screen, its mixture of slightly perverse atmosphere and unnerving moral ambiguity almost always registering more effectively on the page than on celluloid. But Mathieu Amalric does quite a good job in capturing the prolific novelist’s characteristically unsettling tone in “The Blue Room.”

Amalric also stars in the compact but structurally diffuse psychological thriller as Julien Gahyde, a farm-equipment salesman in a provincial French town who appears to be happily married, with a quite lovely wife named Delphine (Lea Drucker) and a daughter. But he’s also engaged in a steamy affair with Esther Despierre (Stephanie Cleau), the wife of a wealthy local druggist. Will they take extreme measures so they can be together?

The story is told in scenes that mix past and present, shuffling between the time frames to establish both a mood and a puzzle narrative that’s never fully finished. Scenes of the couple stealthily meeting for trysts in a small hotel room jostle with courtroom sequences in which they’re on trial for what is at first an unspecified crime, the nature of which is only gradually revealed; both chambers are painted the same blue tint, pointing to the connection between what happens in each of them. These scenes are punctuated by others that reveal their lives apart (like one in which Julien and Delphine go off to the beach, but get involved in some horseplay that takes a decidedly threatening turn), but much of their relationship is disclosed in retrospect through excerpts from Julien’s interrogation by the police, a psychologist, and especially the magistrate (Laurent Poitrenaux) prosecuting the case. What he and Esther are accused of is shown bit by bit through the buildup of these snatches of evidence, pieced together like the shards of a smashed vessel. But what precisely happened and who was responsible remain opaque to the very end.

Amalric handles his acting chores as effectively as he does the direction, and together with editor Francois Gedigier he emphasizes the sharp edges of the various sequences while carefully shepherding them into a grimly fascinating whole. Cleau, who collaborated with him on a script that works diligently to translate Simenon’s style and structure into cinematic forms, is more than a match for him on the acting side as well, just as Esther, in the final analysis, dominates the relationship with Julien.

The supporting cast does excellent work too, but what one is more likely to take away from “The Blue Room” than its performances are its remarkable technical qualities—the precision of Christophe Beaucarne’s cinematography, which uses the old boxy aspect ratio both to emphasize the confined nature of the circumstances in which the characters find themselves trapped and to remind viewers of the classic Hollywood noirs, or the luxuriousness of Gregoire Hetzel’s score, which similarly recalls the tropes of the older films’ musical soundtracks.

Amalric’s film is far from a conventional whodunit, which may disappoint some viewers. It’s more a study of the implacable power of sexual desire that drives people irrevocably to their doom. But the approach remains detached and remote, as if the picture were observing the inevitable outcome of Julien and Esther’s actions with an ironically fatalistic eye, and so it lacks the visceral punch of the old noirs or even of modern copies like “Body Heat.”

But in the end that derives from Amalric’s fidelity to Simenon, who didn’t write in conventional ways, offering genre novels that probed and pushed without necessarily reaching a straightforwardly satisfying resolution. This adaptation of “The Blue Room” doesn’t do so either, and so honors Simenon, but in ways that might frustrate a segment of its audience.