'The Secret Life of Walter Mitty' (PG-13)

The first time we meet Walter Mitty (Ben Stiller), he’s sitting at his computer, logged into the online matchmaking service eHarmony, trying to build up the courage to send a “wink” (the equivalent of a Facebook poke) to Cheryl (Kristen Wiig), a co-worker at Life magazine. Walter’s finger hovers over his keyboard for what feels like an eternity — Stiller, who also directed the movie, is operating on a much subtler comedic vibe here than he did in Tropic Thunder and Zoolander — and when he finally takes a deep breath and clicks the send button, he gets an error message. The wink did not go through. Please try again.

On the outside, Walter comes off as a hapless loner: He’s so quiet and shy, he’s practically invisible. But on the inside — specifically inside his imagination — he’s a fearless daredevil, jumping off train platforms to rescue victims from a burning building, fighting bullies in comic book-style battles that tear up city streets and telling smarmy people off with a ferocity that reduces them to tears. “I live by my ABC: Adventurous, Brave and Creative,” Walter tells himself, even though nothing he does displays any of those qualities. But they’re buried in there somewhere: He just needs a little push to get them out.

The Secret Life of Walter Mitty was adapted from James Thurber’s short story by Steve Conrad (The Weather Man, The Promotion, The Pursuit of Happyness), who has a knack for leavening comedy with an undercurrent of lovely, quiet sadness and who has great empathy for working-class people. The movie is set during a takeover of Life magazine: Its new owners, headed by a cretinous Adam Scott, are preparing to put out the final print issue and need Walter to provide them with the negative the staff’s star photographer Sean O’Connell (Sean Penn) sent him. The only problem: Walter has lost the negative and has no way of getting in contact with Sean, who doesn’t own a cell phone and is constantly traveling to remote places around the world.

So Walter sets out to find him — first stop, Greenland —and soon he’s actually living an adventure, narrowly avoiding getting eaten by sharks, rather than imagining one. The movie’s ending is never in question: By the time he completes his quest, Walter will have emerged from his shell and maybe even have worked up the courage to ask Cheryl out on a date.

But how Walter gets there is unexpected. Far less of a nebbish than Thurber’s character, Stiller plays Mitty as a man who at one point in his life set aside his wild and reckless nature (as a teenager, he was a mohawked skateboarder) and fell too deeply into his dull groove to climb out. But instead of throwing him into a series of Indiana Jones adventures, The Secret Life of Walter Mitty takes a slower, more contemplative route to its protagonist’s inner re-awakening. The fun, flashy fantasy segues into a mellower sequence of encounters and events, culminating with a climb to the upper Himalayas in Afghanistan, in which Mitty doesn’t discover himself: He just remembers who he is.

The Secret Life of Walter Mitty is filled with small, memorable moments that coalesce into a sweet, if predictable, parable about embracing life. Shirley MacLaine pops up as Walter’s ever-forgiving mother, and Wigg kills in an elevating sequence in which she sings David Bowie’s Space Oddity at a karaoke bar. Penn only gets one scene, but it’s a great one, and it reminds you how funny he can be. Even the relationship between Walter and Cheryl, telegraphed as it is, becomes tender and involving. Here is the rare big Hollywood picture that starts out on a huge canvas and gradually shrinks in scope and size to focus on ordinary people. How often do you see that happen?

Cast: Ben Stiller, Kristen Wiig, Adam Scott, Jon Daly, Shirley MacLaine, Sean Penn, Patton Oswalt.

Director: Ben Stiller.

Screenwriter: Steve Conrad. Based on the short story by James Thurber.

Producers: Stuart Cornfeld, Samuel Goldwyn Jr., John Goldwyn, Ben Stiller.

A 20th Century Fox release. Running time: 114 minutes. Vulgar language, action violence, adult themes. Opens Wednesday Dec. 25 at area theaters.