Based on a Dream

We all know that dreams are weird. They're also (usually) rather interesting. Your subconscious can come up with some pretty unusual imagery and concepts when left to its own devices. So it's not surprising that writers, artists, and other creative types sometimes use their dreams as inspiration for their work.

Works based on dreams can be a bit trippy if the dream logic is retained. They also have a tendency to be horror... or occasionally Wish Fulfillment.

Compare Dreaming the Truth, in which the dreamer subconsciously connects the dots and figures out the solution to a problem.

Comic Books

 * The entire point of anthology comic Rare Bit Fiends by Rick Veitch. It was inspired (at least in title) by Dream of the Rarebit Fiend by Winsor McCay, who also did Little Nemo in Slumberland and, yes, a version of Pilgrim's Progress, also fitting the trope.
 * The Garth Ennis Kieron Dwyer story in Flinch based on a nightmare Ennis had after seeing Titanic. It was full of Gorn, Nightmare Fuel, and a supernatural demonic twist but  "Look on the bright side: At least there's no Celine Dion." 
 * A good deal of The Sandman, appropriately enough.

Fan Fiction

 * My Inner Life

Film

 * Terminator, specifically the metal skeleton walking through a fire. From the director's nightmares to yours!
 * Akira Kurosawa's Dreams.
 * The Na'vi from Avatar were partially inspired by a dream James Cameron's mother had about a tall blue woman.

Literature
"People, if you have any prayers, Say prayers for me, And bury me underneath a stone In the stones of Battersea. Bury me underneath a stone, With the sword that was my own, To wait till the holy horn is blown And all poor men are free."
 * The Castle of Otranto, the first Gothic Novel.
 * The Strange Case of Doctor Jekyll and Mr. Hyde
 * Twilight was reportedly based on a dream Stephenie Meyer had about a sparkling vampire lying in a meadow filled with flowers.
 * A lot of the stuff H.P. Lovecraft has written. Nightgaunts are directly based on monsters he had nightmares about as a child and his short story Nyarlathotep was based on a dream he had (the name of the titular messenger and soul of the Outer Gods also came from the dream).
 * Samuel Taylor Coleridge's Kubla Khan is based on part of a dream, since he forgot the rest of it when he was interrupted by a person from Porlock. Also, it wasn't so much a dream as an opium hallucination.
 * Supposedly, Mary Shelley got the idea for Frankenstein in a dream.
 * G. K. Chesterton conceived the initial lines that eventually became The Ballad of the White Horse in a dream:


 * Clive Barker's The Hellbound Heart was inspired by a dream.
 * Stephen King's The Langoliers and Misery.
 * Laurie Halse Anderson stated in an interview that the idea of her book Speak came from a nightmare she had.
 * Lisa McMann's The Wake Trilogy was inspired by a dream she had of entering her husband's dreams.
 * It's sometimes said that Dracula was inspired by an Acid Reflux Nightmare, although Wikipedia fails to confirm this.
 * Flame, from Walter Farley's BlackStallion books, was inspired by a dream the author had under anaesthetic. Within the novel, it becomes the dream of Steve, the young man who eventually finds and tames Flame.
 * Meredith Ann Pierce has stated that The Darkangel Trilogy was spawned from a dream involving "vampires on the moon".

Music
"''I was dreaming when I wrote this Forgive me if it goes astray."
 * David Tibet of Current 93 said that his album Black Ships Ate the Sky is based on a dream he had in which the apocalypse happened and its beginning was signalled by the appearance of black ships that ate the sky. He retains "dream logic" very consistently throughout the entire album to the point where it's the sonic equivalent of an insane, apocalyptic nightmare.
 * The infamously strange and incomprehensible lyrics of REM's "It's The End of the World As We Know It" were reportedly based on a dream Michael Stipe had.
 * The melody to The Beatles' "Yesterday" reportedly came to Paul McCartney in a dream. For some time, he was worried he may have subconsciously plagiarized it.
 * He may well have been influenced, not by a dream but by this huge hit from 1955.
 * Queen's Brian May had a dream about a "great flood" which inspired "The Prophet's Song".
 * In Weird Al Yankovic's "Smells Like Nirvana", the lyrics "it's hard to bargle nawdle zouss" came to him in a dream.
 * The music video to Nirvana's song "Heart-Shaped Box" apparently came from Kurt Kobain's dreams.
 * The Rolling Stones apparently got the beat for "I Can't Get No (Satisfaction)" by listening to a recording of the frontman sleeping. He actually hummed it in his sleep.
 * Sparklehorse's first album was named after the plot summary of a dream the frontman once had.
 * Prince's song "1999" includes the lines


 * Whether that's literally true or not is hard to say.

New Media

 * Walk Smash Walk

Other

 * H. R. Giger models creatures on night terrors.
 * A science example: the man who discovered the ring structure of benzene supposedly did so by dreaming of a snake with its tail in its mouth. Alternatively, he dreamed of six little elves in a ring, each grasping the coattails of another with their right hand and each holding a handkerchief in the left hand.
 * The M-9 electrical anti-aircraft gun was invented by David B. Parkinson after it came to him in a dream, despite the fact that he designed recording equipment for Bell Labs and had no prior experience working with ballistics of any kind. The M-9 ultimately turned the tide in the Battle of Britain.

Video Games

 * LSD Dream Emulator is based on a developer's dream diary.

Webcomics

 * YU+ME: dream
 * The Fruit Pie the Sorcerer strip of Order of the Stick came about after Rich Burlew woke up from dreaming... something that inspired the phrase "goblin fruit pie."

In-fiction examples:


 * H.P. Lovecraft's own characters write or create art based on their dreams as well, which is one of the plot points in Call of Cthulhu (tabletop game).
 * In Supernatural, the whole Supernatural books series is based on one guy's dreams.
 * This is how Professor Farnsworth gets the ideas for his inventions. "It came to me in a dream, and then I forgot it in another dream." Later, his clone Cubert learns how to fix the spaceship's engines the same way.
 * In the first Gabriel Knight game, Gabe's father was said to have got the inspiration for his creepy paintings from his dreams.
 * This strip from Head Trip.
 * Garth Marenghi says that when he was making Darkplace, he often based the stories on his dreams... when he wasn't stealing from dead authors whose copyright had lapsed.