Too few people have noticed how greatly Kevin Bacon has developed as an actor over the years. (Perhaps they’re too busy playing six-degrees-of-separation games involving his name.) He gave an absolutely riveting performance half a decade ago in the sadly underappreciated “Stir of Echoes,” and turns in lesser pictures like “My Dog Skip” have also been impressive. Now he takes on a challenging role as a convicted child molester struggling against his urges after his release from prison in “The Woodsman,” and the effect is wrenching. It’s a great piece of work by an actor at the peak of his powers.

It’s a pity that as a whole Nicole Kassell’s film isn’t worthy of him. Adapted by the director and Steven Fechter from a play by the latter, it’s praiseworthy for taking on a provocative subject, but disappointing in some of the choices it makes in the process. Simply put, the film goes out of its way to depict the character Bacon plays in more sympathetic strokes than would be dramatically ideal. It’s not that the picture portrays him as cured–rather he still struggles with his inclinations. But it does make every effort to show him as a kind of victim as well as a predator (by, among other things, having him harassed by a cop and “outed” to his co-workers by a secretary whose advances he rebuffed), and especially to contrast him with others who are “worse” than he is–indeed, he even takes on a curiously heroic cast when dealing with one such individual. (In this connection it seems especially nasty that the person from whom he’s most decisively distinguished is a guy who preys on young boys rather than girls, as he does–an emphasis that could easily be thought homophobic.) And in the end it suggests, though obliquely, that the protagonist can be “saved” through the love of a good woman (in this case an initially dismissive but ultimately concerned co-worker)–a cop-out if ever one existed. As a result “The Woodsman” winds up, despite Bacon’s excellence, far less honest and courageous than a film like Michael Cuesta’s “L.I.E.” (2001), which dared to portray the burly seducer played by Brian Cox as conflicted but still predatory, and with a taste for young boys rather than girls–and yet still, somehow, pitiable rather than odious.

As “The Woodsman” opens, Walter (Bacon) is taking up residence in a shabby Philadelphia apartment across the street from a schoolyard. (The locale, it must be said, is unlikely in a society in which those convicted of molestation are generally prohibited by law from settling near schools.) He also begins a job in a lumber yard operated by Bob (David Alan Grier), an old employer of his father. His only friend is his brother-in-law Carlos (Benjamin Bratt), who’s trying to arrange a reconciliation between Walter and his estranged sister, and he’s periodically visited by a suspicious cop (Mos Def) whose contempt for him is obvious. At work the reticent, aloof Walter quietly spurns Bob’s secretary Mary-Kay (Eve), who–apparently in retaliation–begins researching his past on the internet. Meanwhile Walter strikes up a halting relationship with Vickie (Kyra Sedgwick), the solitary female yardworker whose abrasiveness is a defense mechanism against the other men’s habitual ragging. She stands by him even when Mary-Kay’s inquiries lead to Walter’s past being revealed, with predictable results.

All this plot is interesting enough, but what stands out in the picture are the scenes that simply focus on Bacon. The fact that Walter’s apartment faces a playground may be implausible, for instance, but the circumstance provides the character with the opportunity to watch the children from his window, allowing Bacon to show Walter’s struggle against his inclinations–as also do regular sessions the man has with a therapist. But the most powerful moments undoubtedly come when Walter encounters a lonely young girl (Hannah Pilkes) in a park and tries simultaneously to seduce her and to resist the urge to do so. Bacon is brilliant here, and Pilkes plays against him with beautiful restraint. Unfortunately, the scene builds up to a revelation concerning the girl’s father that offers a dramatic resolution–allowing Walter to pull back from temptation in a decision that suggests his redemption; but however well played, the turn can’t help but seem contrived. The same is true of Walter’s observation of a predator (Kevin Rice) accosting young boys near the schoolyard. It’s not merely that the blatancy of the man’s actions doesn’t ring true; certainly someone other than Walter would have seen (and doubtlessly reported) him. The problem is that the entire episode seems too calculated a device to exhibit the protagonist’s moral superiority over a similarly troubled person who’s giving in to his desires rather than struggling to overcome them. Even here, however, Bacon is extraordinarily good.

The rest of the cast, unhappily, is on a less exalted level. Sedgwick is too hard-bitten by half, and Mos Def strikes amateurish poses as the unsympathetic cop; Eve is equally beyond her depth as the trouble-making secretary. On the other hand, Bratt’s energy works reasonably well, and Grier is nicely subdued as the gruff but supportive lumberyard owner. There’s nothing special about “The Woodsman” from a technical perspective, but the gritty look of Xavier Perez Grobet’s cinematography is appropriate to the material. Nathan Larson contributes a subtle score that complements the visuals well.

Kevin Bacon’s superb performance alone is reason enough to recommend “The Woodsman.” It’s too bad that the film itself isn’t as courageous as he is.