Pictures from Dorian Gray

I've been exploring the potential of the pix2pix system for generating photos from abstract representations of objects. A popular version of this currently buzzing around the internet is edges2cats, because cats, and more interesting work is being done by Mario Klingemann.

The basic principle is fairly simple. You create a pair of images. One is the original image and the other is an abstraction, usually an outline. You then train a neural network to try to generate the original from the abstraction. This is analogous to teaching a child to recognise dogs. You show it lots of pictures of different dogs labelled "dog" and eventually the child will correctly identify a dog even if it's never seen that specific dog before.

Once you've trained the system, you can then give it abstractions and ask it to figure out the "original". In theory it produces something that looks real, which is the goal of these systems. In practice it's very easy to produce something that looks weird and interesting, which is why artists have latched on to this stuff.

As well as the joy of producing weird images, I'm interested in exploring what's actually happening in these systems by poking them with sticks. I was drawn to Mario's use of blurred abstractions to create an oil-paint effect and wondered what other sorts of abstractions could be used. Since some of my work has involved transforming between mediums (image to sound, etc) I thought I'd give ASCII Art a try.

I used a collection of "classic photography" I'd found a while back as my training data and produced ASCII versions of each picture using the process included in Apple's Automator app. Here's an example.

The ASCII here is quite fine and uses all the possible characters, which wasn't giving me the abstraction I needed, so I went with jp2a which gave me a lot more control. Specifically I could up the font size and chose which characters it used. By limiting it to lower-case a-z and select punctuation I was able to generate this:

Now the abstraction looks closer to real text, the sort you might get in a book that makes sense. This is what I was after.

With the training underway I started to prepare my input for the final piece. I needed a body of text and settled on the Gutenberg edition of Oscar Wilde's The Picture of Dorian Gray because one should always go for the pun, but any text would do. I removed all paragraphs and extraneous spacing and exported it into squares which resembled the generated ASCII art. Here's the first page.

Once the training had finished processing overnight (it's a long process, though my electricity usage plug says it only cost 24p for 12 hours, which isn't bad) I asked it to generate photos from all 91 pages. Here's that first page again.

And here's all the pages in a video:

You can also download it as a PDF if you like.

Much more to be done, which is why this is a blog post and not on my Art website yet. Onwards!

Up next UTM_cruft For a while now, web applications have been trying to obfuscate the URL, presumably because ordinary people can't deal with the concept of an ASCII to Abbey
Latest posts Update your Feed Reader! This blog has been mothballed. Revising the 1972 Project Starmer has effectively introduced a Twitter policy We desperately need social media literacy or the fascists will win History is constantly being “erased”, and that’s OK. Last week a jigsaw saved my life Lost in Bluster Insomnia Journal 07 May 20 Stirchley Safari Whales on the Hudson Closing the Covid browser tabs Solving (a bit of) the Coronavirus from home Stopping A proposal to support independent businesses that cannot survive social distancing A modest proposal for slowing down cars Cross City Walks - the movie Good composition is ideologically fraught Short Reviews of Films Understanding Gilliam, and other men of a certain age Grace Lee’s talk: Diary, Discourse and Demonetisation Star Wars is Over (in a good way) Election notes How to read articles on websites that don’t want you to read their articles Uranium Club RIP Tom Spurgeon Introducing Notes, my new microblog Lindelof’s Watchmen, and the creative employment of corporate IP Eisenhower and the Hippies The Widelux, as used by Jeff Bridges Media with Edges Art-trip to Liverpool