Home For Fiction – Blog

for thinking people

Patreon LogoPatreon

October 25, 2021

Text to Art: Turn Your Novel into an Art Design

Literature, Programming

art, creativity, literature, programming

Translating texts into other forms of art is something that fascinates me. Especially when some sort of semi-random, computer-mediated process is involved. There’s something idealistic about it, having to do with aesthetics, beauty, and the meaning behind art which, remember, is holistic. And so, Text to Art is a little program I put together to explore this very thing: How turning a text – a poem, a novel, or a simple sentence – into a visual design would look like.

text to art
Text to Art is a program that generates unique visual designs from a given text

Text to Art: How It Works

The interesting thing about Text to Art is that the designs are made using the uniquely calculated hash number associated with the text. Though each render returns a slightly varied result (due to subtle randomization patterns), each work has a distinctive style, present in all renders. However, even a very slight change – a single sentence in an entire novel – can greatly modify the result.

And so, the string “Burden of proof” generates the hash 1525781130233444 and returns the image you see above. Yet the string “burden of proof” (lowercase “b”), generates the hash 8484125097351894 and returns this:

text to art

The program uses the uniquely calculated hash to decide on things like, among others, the color palette, the shapes that will be used and their arrangement, as well as density and similar factors. As I said, each time you run the renderer, the result is subtly different, but the overall style and theme are unchanged, allowing you to associate a design with a given text.

A Few Examples

For example, here is a set of three renders for A Christmas Carol:

And here’s another set of three renders, this time for Dracula:

Do you know what the fourth image is? It’s what happens when you change one (1) of the ~160,000 wordsI suppose we would refer to this as the wordCount of the novel! found in Bram Stoker’s novel. I changed “My dearest Mina” to “My dear Mina”. Look how entirely different the result is!

Does all this sound a bit familiar? It’s based on ideas I’ve used before, mostly my Book Worming Party project. The beauty of Text to Art, however, is that it’s much simpler, more intuitive, and you can use it yourself!

How, you might ask.

Where to Find and Use Text to Art

You can try Text to Art following this link. For a full list of my available programs, see the relevant page on the main site.

Note: Looking for code doing the opposite, that is, image-to-text? Why don’t you take a look at my silly attempt using TensorFlow?

Home for Fiction apps are Patreon-only content. To get access, become a patron of Home for Fiction, then follow the link to the app shared in this post.

You can also try the programs for free by joining Home for Fiction on Patreon (as a non-paying patron). You get 3 tries per month to use on any of the programs.