The 1971 film version of Roald Dahl’s beloved story “Charlie and the Chocolate Factory” is one of those movies that a kid sees and adores, only to watch it as an adult and wonder what the hell they were thinking of back then. Sure, it had a number of nifty special effects and a scarily effective performance from Gene Wilder in the role of candymaker Willy Wonka–the things that everyone remembers–but it also contains far too many songs for its own good, a relatively drab narrative style and a cast that, with the exception of Wilder and Jack Albertson (as the wily Grandpa Joe), was uniformly dull and unmemorable. (This probably explains why the title was changed to “Willy Wonka and the Chocolate Factory.”) The problem was that the film was essentially designed as a vehicle by Quaker Oats, who financed the project, to sell candy bars and whatever artistic merits it might have were secondary. Don’t get me wrong–I have a soft spot in my heart for it but you never get the sense while watching it that journeyman director Mel Stuart had any real feel or connection with the material

What makes the new adaptation of “Charlie and the Chocolate Factory” such an amazing film–and yes, I would put it right up there with the likes of the “Harry Potter” films and “The Adventures of Baron Munchausen” as an instant family classic–is that it is obvious from the opening frames that director Tim Burton has a perfect connection to Dahl’s original story. No doubt Burton was hired both for his visual skills and for the fact that this particular combination of director and property sounds like a match made in heaven. (Of course, we all said that about the idea of Burton doing “Planet of the Apes” and look how that turned out.) However, what really makes the film succeed is that Burton shares Dahl’s unique method of blending sentimentality and sadism into a creepy, funny and always tasty confection that will elate children of all ages and horrify those parents without a sense of macabre humor. As a result, this is both the best screen version of one of Dahl’s works to date and Burton’s most consistent work since the sadly underrated “Mars Attacks!”

A brief recap for those who have never read the story or seen the original film. Reclusive candy tycoon Willy Wonka (Johnny Depp) decides to hold a worldwide contest in which the children who find the five golden tickets hidden inside Wonka Bar packages will be given a tour of his top-secret factory. One of the zillions of children dreaming of winning that ticket is Charlie Bucket (Freddie Highmore), a young lad who lives in wretched poverty with his loving parents (Noah Taylor and Helena Bonham Carter) and all four grandparents in a tiny ramshackle shack. Because of sheer luck, and perhaps because he is, after all, the best little boy in the world, Charlie wins a ticket and finds himself, along with Grandpa Joe (David Kelley) outside the Wonka Factory gates with the other winners–gluttonous Augustus Gloop (Philip Wiegratz), overachiever Violet Beauregarde (Annasophia Robb), spoiled rotten Veruca Salt (Julia Winter) and know-it-all wise-ass Mike Teevee(Jordon Fry)–waiting for the signal to enter. When it comes–in the shape of a group of singing puppets that inadvertently catch on fire–they decide not to take it as a warning and, with the seemingly demented Wonka as their guide, they begin the decidedly non-OSHA-approved tour.

Those familiar with the story will know that the bad children begin to misbehave in various ways and wind up paying a terrible price for their transgressions–one is attacked by squirrels while another winds up requiring an emergency juicing–as the queer little people known as Oompa Loompas (all played by Deep Roy) sing malevolent ditties about the perils of misbehaving. However, it turns out that Burton and screenwriter John August have a few tricks up their sleeve in order to flesh out the character of Wonka. Specifically, we get flashbacks so that we can see the kind of strange childhood that would form an adult as loopy as Wonka. The first clue is that his fearsome father, almost inevitably, was a dentist. The second clue is that Dad, just as inevitably (considering that this is a Tim Burton film) is played by none other than Christopher Lee, a man who could put a warp or two in anyone’s record.

Visually, “Charlie and the Chocolate Factory” is a wonder to behold–how could it be anything else with a visual stylist like Burton at the helm, an army of technicians at his disposal and an ace cinematographer like Philippe Rousselot capturing the images? The opening scenes, in which we see the details of Charlie’s hard-knock life, maintain an effective blend of reality and fairy-tale imagery that is quietly effective. Once we get inside the factory, all bets are off and Burton keeps throwing one spectacular image or idea after another and the amazing thing is how many of them stick. Among the treats are a series of wild musical performances from the Oompa Loompas (one is done in the style of N’Sync while another finds them donning Sgt. Pepper-era outfits), weirdo bits of humor (such as the moment when we learn how Wonka makes his whipped cream) and a scene which manages to cover one of the key plot points of the book while also working as both a sly dig at how genuine art can be reduced to just another advertisement (like the odious Pepsi ads that manipulate scenes from “Spartacus”) and a hilarious homage to one of the most famous moments in film history.

What makes the film more than just a piece of especially attractive eye candy is that Burton has lavished just as much time and attention on the characters and the story as he has on the visuals. While Charlie in the first film was clean and well-scrubbed and kind of boring, Freddie Highmore (who previously appeared opposite Depp in “Finding Neverland”) comes across as a real little boy while still retaining the essential goodness of Dahl’s original creation. The brattier kids are just as good as being little snots–so good, in fact, that everyone in the audience will cheer as they get their vicious comeuppance one by one without ever feeling guilty about the sight of them getting their just desserts–also retaining Dahl’s original intentions. (Here, even though we are told that the kids are going to be all right, the final shot we get of them deliciously suggests otherwise.) Even the additions to the story work uncommonly well here because they seem to have been developed out of a love for the material and not just from a desire from someone to put their own stamp on someone else’s material.

Of course, the real jaw-dropper here is the performance from Johnny Depp–a turn so flamboyant that it makes his work in “Pirates of the Caribbean” seem positively staid by comparison. Although some have suggest that he has based his character on Michael Jackson (in much the way that he was said to have based Capt. Jack Sparrow on Keith Richards), his performance is the kind of one-of-a-kind work that doesn’t seem to have been influenced by anything on this planet. However, while this could have easily to a grotesque scenery-chewing farce, Depp’s performance works wonders because of two things. The first is that every freaky move he makes–and believe me, they get pretty freaky–manages to simultaneously seem both utterly unthinkable and utterly right in every single scene; you can’t imagine anyone else coming up with such stuff but once you see it, you can’t possibly think of another way to do it. The second is that he is such a finely-tuned actor at this point that he can be completely weird and yet still generate a genuine rapport with his fellow actors even while his character is keeping them at arms length–he has a nice on-screen chemistry with Highmore and his scene with Lee is quite possibly the most sincerely touching that either one has ever performed.

“Charlie and the Chocolate Factory” is a real winner–the kind of family film that kids will adore (and perhaps even become inspired to check out Dahl’s other literary works) and that will make adults wonder why they didn’t have films that good when they were younger. It is funny, creepy, touching and throughly enchanting work that will satisfy the cinematic sweet tooth of anyone looking for genuine enchantment in their multiplexes this summer. There have been a few great films–“Land of the Dead” and “Batman Begins” come to mind–but those have been largely dark and grim experiences. This film, on the other hand, is the kind of experience that will send everyone out into the street with a smile–one that doesn’t come simply from the absence of “The Candy Man” on the soundtrack.