A bloody Taj Mahal. A haunted Colosseum. A toxic Capitol Hill.

Welcome to the "Nightmare Machine," a horror-imagery project created by three researchers at the Massachusetts Institute of Technology. Pinar Yanardag, Manuel Cebrian and Iyad Rahwan used artificial intelligence algorithms "to learn how haunted houses, or toxic cities look. ... Then, we apply the learnt style to famous landmarks and present [to] you: AI-powered horror all over the world!"

The project website is up just in time for Halloween but the method is not new — the algorithm they use is a so-called "deep learning" system published last year by computer scientists, which is capable of creating "artistic images of high perceptual quality" based on examples of images created by humans.

"High perceptual quality" basically means the images look good to people who see them.

The researchers taught the algorithm at least eight horror styles for haunted places: haunted house, fright night, slaughterhouse, toxic city, ghost town, inferno, tentacle monster and alien invasion.

They applied the algorithm's understanding of the qualities of each style to images of famous landmarks to create creepy computer-generated images of, for example, the Golden Gate Bridge being attacked by a tentacle monster.

Or the Louvre in Hell.

Or ghostly Palmyra.

Those hyperlinks also show the original image, and how the algorithm transformed it. You can also see more AI-generated images on the Nightmare Machine Instagram.

The same team used another artificial intelligence algorithm to create scary images of faces, and they are perfecting it by asking the public torate the scariness of computer-generated portraits on their website (you can choose "scary" or "not scary" for each one.)

Here's one of the portraits the algorithm generated.

The difference between what they are doing and Photoshop distortion is that humans are not involved in changing the image — although people wrote the algorithm and showed it images, the system learned from what it saw and applied those principles to create copycat horror images all on its own.

As we have reported, deep learning AI is the next big thing in the tech and computing world. Netflix, Google and Facebook are all investing in the method of teaching computers to tell things apart and recognize patterns. A post from last year on Google research blognotes that discriminating between images, which search engines are interested in doing, and generating new images, which the MIT project did, are actually related skills.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.