If you were taking your kids out for pizza, would you rather take them to Pizza Hut, or to some out-of-the-way brick-oven restaurant where you can watch the staff hand-toss the dough and they use their own homemade sauce?

Would you rather go for burgers at McDonald’s, which boasts “billions and billions served,” or some family-owned grill long known to locals for the best burgers in the area?

Too many of us, alas, willingly settle for the generic, homogenized fast-food experience over the fresh, the distinctive, the well-prepared.

At the cinemaplex, family audiences regularly power mediocre efforts like Madagascar and The Santa Clause 2 to bloated nine-figure grosses, while superior family films — say, Holes or Wallace & Gromit: The Curse of the Were-Rabbit — do far less business.

There are gratifying exceptions. Ever since Toy Story kicked off Pixar’s extraordinary body of work a dozen years ago, the studio’s seemingly magical touch, combining consistent quality and heart on the one hand with popular and critical success on the other, has served as a tacit rebuke to what passes for family entertainment in Hollywood.

Ratatouille, Pixar’s latest triumph from The Incredibles director Brad Bird, covers some familiar ground for family films: overcoming prejudices, following your heart, believing in yourself. But it’s also a family film about pursuing excellence rather than settling for mediocrity, not compromising principles for a quick buck, and putting your heart and soul into something you believe in, even if it’s a risk.

It’s a film of winning sincerity and conviction, from filmmakers unafraid to practice what they preach. The film exemplifies its own message: A small-scale story about a sensitive, talented rat longing to be a world-class chef in a five-star Parisian restaurant isn’t the most obvious pitch for a surefire family hit. Cloning Finding Nemo or The Incredibles would probably be a safer bet; even Cars probably looks better on paper.

But Ratatouille is a revelation — a delightfully surprising discovery in a genre that seldom surprises even savvy youngsters, a warm and winsome confection that will be treasured by viewers young and old long after the mediocrities of summer 2007 have been justly forgotten.

In his family, Remy (comic Patton Oswalt) stands out. A rat with an unusually refined palate and acute sense of smell, he longs to indulge on more than the garbage that sustains his large, undemanding clan. More, Remy is unhappy with his species’ legacy of living by stealing; inspired by human creativity with food, he longs to be a giver, not just a taker.

“I know I’m supposed to hate humans,” he says sheepishly to his baffled father (Brian Dennehy), “but there’s something about them — they create, they discover. Just look what they do with food!”

On television, while the owner of the house they live in snores away, Remy is captivated by celebrated chef Auguste Gusteau (Brad Garrett of “Everybody Loves Raymond”), whose popular cooking show and best-selling cookbook celebrate his populist philosophy, “Anyone can cook!”

But then Remy and his family lose their home, while Gusteau’s prestige is tarnished after an unfavorable review of his bistro from legendary food critic Anton Ego (Peter O’Toole in a hilariously haughty performance), followed by the sudden death of the great chef himself. Now his shaky legacy is in the hands of the diminutive, parsimonious sous chef Skinner (excellent Ian Holm), who’s primarily interested in cashing in on the master’s name value with licensing deals for frozen food and the like.

That’s when fate takes a hand. Remy’s path crosses that of an awkward, shy young garbage boy named Linguini (Lou Romano, The Incredibles), and the two forge an unlikely partnership in the kitchen, while Skinner looks on suspiciously and Colette (Janeane Garafalo), the kitchen’s lone woman, tries to figure out what’s going on.

All of this builds to a third-act climax as thrilling and hilarious as it is unexpected. Without spoiling the nature of Linguini’s and Remy’s collaboration, I can say that Linguini gives the best physical “performance” of a CGI cartoon character to date, virtually rivaling the likes of Steve Martin in All of Me and Vincent D’Onofrio in Men in Black.

Like most of Pixar’s oeuvre, Ratatouille is aimed not only at kids’ funny bones, but their parents’ hearts and minds. It’s a little more sophisticated than the average Pixar film, perhaps, and kids under 5 might find the middle act slow going. Parents should also note that a plot point involves one character’s out-of-wedlock parentage (neither parent is a real character in the story, but it’s clear that they weren’t married).

Ironically, much like Skinner cashing in on Gusteau’s legacy with merchandising deals, Disney has for years been ransacking its classic canon with second-rate sequels like Return to Never Land and Jungle Book 2.

Ever since coming on board at Disney, Pixar honcho John Lasseter (director of the Toy Story films) has been working to pull the plug on such projects, and a couple of weeks ago he reportedly got the whole line scrapped.

I can’t say I blame the bean counters at Disney for being nervous about Ratatouille. The last murine (rat-related) computer-animated family film, Flushed Away, was a genial but middling effort, and flopped at the box office. Ratatouille is a vastly superior film, but artistry and excellence aren’t always rewarded at the box office. Still, in the long run, integrity and excellence are probably a better business model than always going for the easy dollar.

Steven D. Greydanus is editor

and chief critic of DecentFilms.com.