Instead, after production halted for several months, filming restarted with Johnny Depp, Jude Law and Colin Farrell taking turns to complete Ledger's role. Thanks to nimble rewriting, the stars ended up playing a character whose appearance changes as he travels between imaginary worlds. These three marquee names have greatly improved the film's box office prospects. And for Gilliam, the out-there director of Brazil, The Adventures of Baron Munchausen and Twelve Monkeys, the arrival of a shape-shifting protagonist offered exciting and innovative possibilities.

In 1999, the hard-living Reed (who had worked with Gilliam on Munchausen) finally dropped dead after a beer, whisky and rum bender. "I'd like to think I would be brave enough to drink myself into the grave," he once said, and so he did, part-way through filming Gladiator. Director Ridley Scott was unimpressed. The mega-budget swords-and-sandals epic was to have marked a comeback for Reed but a mega-binge in Malta during a break in filming proved his last. Computer-generated effects enabled Reed to "appear" in the scenes he had not yet shot, with his face digitally superimposed on to a body double and on to a mannequin. Even with a reworked script in which his character, gladiator owner-trainer Antonius Proximo, died, however, the effects were laborious and expensive, costing $US3.2 million for an extra two minutes of screen time. In 1973, just days before the release of Enter The Dragon, martial arts dynamo Bruce Lee died after complaining of a headache, aged 32. For his next project he had been planning to finish Game of Death, a film displaying his branch of martial artistry, for which he'd already shot 100 minutes of footage.

This formed the core of 1978's Game of Death, co-starring Kareem Abdul-Jabbar. Unfortunately, the fight footage was fleshed out with scenes featuring Lee look-alikes and stunt doubles shot in shadowy half-light. Hilariously, the 1978 film had a shot of a body double looking into a mirror, an unmistakable cardboard cut-out of Lee's face glued to its surface. In 1993, Bruce Lee's 28-year-old son Brandon was starring in The Crow, a gothic drama directed by Australian Alex Proyas, when co-star Michael Massee fired a gun at him. In a fatal accident, the gun was loaded with a blank, which fired a residual bullet into Lee's spine. He died the next day.

With only eight more days of filming required, Lee's fiancee and mother supported Proyas's decision to finish. Proyas hired a friend of Lee's, Chad Stahelski, as a stunt double, superimposing Lee's face onto his stand-in's. In death, Brandon Lee became a gothic legend. Bela Lugosi spent his life as a gothic legend. B-film director Ed Wood had taken footage of Lugosi in a cape for a planned vampire feature, but couldn't raise funding. When Lugosi died in 1956, Wood was undeterred. For his 1959 sci-fi shocker, Plan 9 From Outer Space, Wood interspersed his old footage of Lugosi with new footage of Tom Mason, Wood's wife's chiropractor. Mason half-covered his face with a cape in every scene, but still the similarity was, well, canny. As Leonard Maltin wrote, "Lugosi died during production, and it shows." In 1982, Vic Morrow and two child co-stars died in a helicopter accident on the set of Twilight Zone: The Movie. Litigation lasted more than a decade. Morrow's key scenes were shot so the film was released, to mixed reviews and minor success.

Film sets can be dangerous. Stars and stuntmen are regularly injured and occasionally killed. During the filming of Shirley Barrett's Love Serenade, stuntman Collin Dragsbaek died after falling from a silo onto a faulty airbag. Released in 1996, the drama received a low-key response. Conjecture continues as to whether or not a stuntman died on the set of 1959's Ben-Hur. Shot in Rome on the largest film set ever built, it culminated in an epic chariot race, with stand-in dummies depicting men being run over and killed.

But were they dummies? "We had a stuntman killed in the third week, and it happened right in front of me," wrote stuntman Nosher Powell. "You saw it, too, because the cameras kept turning and it's in the movie." However, director William Wyler and second unit director Yakima Canutt say no serious injuries or deaths occurred during filming. With movies, it can be tough to differentiate reality from myth. That's also true for The Imaginarium of Dr Parnassus. Terry Gilliam has said that the last line spoken by Ledger during filming was improvised: "Don't shoot the messenger." On the set several months later, Depp ad-libbed precisely the same line.

"Heath is still out there," Gilliam said. "Johnny's channelling Heath somehow. I mean, Shirley MacLaine would love all this." The Imaginarium of Dr Parnassus opens on Thursday.