Lunacy is a 2005 animated horror comedy-drama film written and directed by Jan Švankmajer. It is loosely based on two Edgar Allan Poe short stories, "The System of Doctor Tarr and Professor Fether" (1845) and "The Premature Burial" (1844), and partly inspired by the works of the Marquis de Sade. The film was shot between October 2004 and April 2005, on location in the village of Peruc close to Prague, and in Švankmajer's studio in the village of Knovíz.