It's possible you're thinking of a few different films:
* "The Imaginarium of Doctor Parnassus" (2009) features Heath Ledger and Jude Law, but not Johnny Depp.
* "Sweeney Todd: The Demon Barber of Fleet Street" (2007) features Johnny Depp and Helena Bonham Carter (who is often paired with Depp), but not Jude Law or Heath Ledger.
It's easy to see how you might conflate these films, as they are all visually stunning and feature well-known actors.