Create ASCII Stencils from Book Quotes - Harry Potter

I've been playing around with creating N-grams from books. Just to see how this is done, what the results look like, and how you can use these N-grams for visualizations. I started with the seven Harry Potter books to see what kind of N-grams were created. So after creating N-grams from size one to size 10, and counting them I got around 5.500.000 distinct N-Grams of various length and number of occurences. My next step was to find an interesting way of visualizing these N-Grams, and to get some inspiration I was looking though my 'to-read' list from getPocket. There I ran into someone, Mike Matola, who created posters from copying lines of film scripts to "compose portraits of music and film icons".

So I set out to do the same thing. Just not by hand, and using the most common occurences of sentences to fill an image. In the next couple of days I'll update my site and show you how I created the ngrams from the input material, and how that input can be converted to create these kind of images. I've you're interested in specific scenes, stencils, books or images let me know. The generation is a bit time consuming, but, luckily, completely automatically.

First set of stencils: Hermione, Harry and Dobby

Below you can find the first set of stencils I created. You should really view them in there full resolution! If you want a custom one, have interesting stencils that could be used, or want a set of different books and stencils created, let me know and I'll see what I can do. Note that at the moment, they aren't perfect yet. You can see some repeating texts in the large black areas at the bottom. After I created these images I added some randomizing to these large section for a more natural look. So in future images this will probably look better.

Hermione:

Harry:

Dobby:

More information and articles on smartjava.org