The consistently amusing "Puss in Boots" should appease audiences and shareholders alike as the swashbuckling cat leaves his prints all over the fall box office.

Now that the ogre’s tale is over, DreamWorks Animation must find a franchise to fill Shrek’s shoes, and it’s hard to imagine a safer choice than “Puss in Boots,” featuring a character spun off from the very same series. And yet, however crass the motivation for its existence, Puss’ origin story could easily stand on its own — a testament to clever writing on the part of its creative team and an irresistible central performance by Antonio Banderas. The consistently amusing result should appease audiences and shareholders alike as the swashbuckling cat leaves his prints all over the fall box office.

Over the years, critics have carefully scrutinized Disney’s adaptations of beloved fairy tales, often picking apart the slightest variation from Hans Christian Andersen, the Brothers Grimm, et al. When DreamWorks gets its paws on such material, however, we’ve come to expect irreverence and revisionism, and “Puss in Boots” is no different, abandoning any connection to Charles Perrault’s 17th-century fable (whose ogre-outwitting twist explains what Puss was doing in “Shrek 2″ to begin with) in favor of a cheeky, Zorro-like lark.

Here we learn that Puss (voiced by Banderas, parlaying his thick Spanish accent into a seductive purr) was an orphan turned outlaw by a misunderstanding from his past. Once the town hero, having earned his boots and the citizens’ respect after saving an old woman from a raging bull, Puss was later chased out of town for his involvement in a local bank robbery. The true culprit was Humpty Dumpty (Zach Galifianakis), still grumpy after all these years for serving prison time while Puss chased his own tales, a free cat.

Still angry with one another, the former accomplices nevertheless agree to team up once again, scheming to steal three magic beans from Jack and Jill (two hulking and hilariously surly goons voiced by Billy Bob Thornton and Amy Sedaris), then climb the beanstalk to a castle in the clouds, where they can nab the golden goose and repay their debts back home. For Puss, the deciding factor is getting to work with a cat burglar named Kitty Softpaws (Salma Hayek), who steals his heart by out-maneuvering him in the field, as well as on the dance floor.

So begins an epic quest that somehow manages to thrill without ever taking itself seriously, at least for the first hour or so. Not unlike the original “Shrek,” which put a modern twist on centuries-old folk stories, “Puss in Boots” plays fast and loose with familiar fairy-tale ingredients, to the extent that the Godzilla-like attack by a giant Mother Goose that comprises the toon’s third act doesn’t seem entirely out of place in light of all the zaniness that has come before. Screenwriter Tom Wheeler (working from a story concocted by Brian Lynch, Will Davies and himself) paves over the more egregious leaps in logic by laying the foundation early, so a gag in which Humpty Dumpty’s horse-drawn coach suddenly takes to the skies can be explained by an earlier scene where the young egg is seen experimenting with flying contraptions.

Overall, the writing team seems to have learned a lesson from DreamWorks’ “Shark Tale,” which drowned amid an abundance of frivolous fish puns; with “Puss in Boots,” though cat jokes abound (as do a predictable number of adult-targeted in-jokes), they never overwhelm the central story. Still, much of the character’s charm traces back to the fact that his feline tendencies come out at the most inopportune times. With Puss, the situation has always been that no one would expect such an over-confident Latin lover personality in an otherwise harmless-looking ginger tomcat, and nearly every amusing detail in the character’s feature-length outing derives from that mismatch.

Director Chris Miller (“Shrek the Third”) arguably applies the same strategy to Humpty Dumpty, whose petulant voice and creepy egg-face design run counter to whatever expectations auds may have about the nursery-rhyme victim. Certainly they wouldn’t imagine him as the conniving mastermind capable of hatching a plot as elaborate as this, and yet his true motives merely serve to complicate an otherwise elegant adventure. As is often the case with DreamWorks toons, things spiral out of control toward the end, as if the creators’ confidence in storytelling were shaken by the mistaken assumption that auds demand spectacle. Fortunately, they have the good sense to leave out the rest of the Shrek ensemble (including the ogre himself).

Even so, “Puss in Boots” feels a lot longer than its 90-minute runtime and would have done just fine without its over-the-top finale. Besides, Miller and his team have supplied no shortage of spectacle along the way, using stereoscopic 3D to whisk audiences through gorgeously rendered spaces. Puss’ initial pursuit of Kitty across the town balconies and roofs is a virtuoso use of the technique, as are later sequences, including the characters’ dynamic canyon chase and beanstalk ride. Miller also juices the storytelling with occasional split-screen effects, lending still more style and self-aware humor to the mix.