Computer generated art

I woke up yesterday with a simple idea for generating a picture based on an input string. I don’t exactly know where the idea came from, but i think i’ve been influenced by Nick Huggins, whose abstract work i adore, and also in a way by QR codes. I’m not a particularly artistic person, but i figured i could come up with an algorithm and let the computer do the creative bit for me! :)

So i installed the open source tools ImageMagick and RMagick, learned a bit about the RVG library, and set about trying some ideas. I fiddled and tweaked the algorithm until it seemed to consistently output something that was reasonably pleasant. Here is the picture for my name, and for my twitter id.

aimee @sermoa

Having tried random numbers and obvious inputs like my name, i searched for other input sources. Being interested in community generated content, i wrote a script to fetch the current top twitter trends. Here are the results.

Kim Hee Chul Solomon Burke Steamed Bun #thingsyoushouldntsay HEEBUM
#badsongsinjail Limera1n Aiden #bsr_tousounow One Direction

As you can see, some come out better than others. I’m adding the input string mostly for debugging purposes so that i can see how the image was seeded. When i get one that i like, i can increase the blur and remove the input string. For example, i really like the images produced by “Kim Hee Chul” and “#bsr_tousounow”, so let’s try with a bit more blur.

Kim Hee Chul (with more blur) #bsr_tousounow

Nice, hey?! Not sure they’re ready for a gallery just yet, but certainly an interesting experiment.

Everything in the picture is generated from the input string: the size, colour, number of boxes, box sizes, opacity, border style. It is extremely unlikely that any two input strings would ever generate the same picture. However, the algorithm is not random. Given an input string, you’ll always get the same picture, though i may choose to do some post-processing on it (such as blur, frame, lighten or darken).

In the interests of sharing knowledge here is the main structure of my generator, but the really creative part is in how it comes up with the numbers, which is going to remain a secret, sorry!

I am willing to generate images for anybody who asks nicely! :)

Advertisements

The Wessex Wyvern as SVG

I needed to find a good quality image of a Wyvern, the symbol of Wessex, ancient kingdom of the West Saxons. The best i could find was the image on the Wessex Flag, below, but it is poor quality and can’t be scaled up. So i had to learn a bit about path tracing and scalable vector graphics.

Wessex Wyvern (low quality)

Wessex Flag by Chrys Fear, found at fotw.net/flags/gb-wessx.html

I used a combination of the free open source graphics tools GIMP, Inkscape and Potrace to trace the shape into vector format. Even at the same size, it’s already much better, saved here in PNG format:

Wessex Wyvern (higher quality)

The SVG is infinitely scalable and you can download it here: wessex-wyvern.svg

Here you can see the quality improvement:

Before and after - close up

Here is a close up of the eye, which took a bit of work to get the paths just right:

Close up of the Wyvern's eye

I needed the Wyvern to form part of the Bi Wessex flag. Here is what we are affectionately calling the Bivern!

The Bivern (Bi Wessex Wyvern)

The Bi Wessex flag is also available as SVG, should you want it: bi-wessex-flag.svg

If you need to improve the quality of an image, i hope you will feel encouraged that it is possible, with a little bit of effort and experimentation.

Album art meme

For once, a meme that’s actually worth doing! My thanks go to Kapitano for this one. It takes a little while to do, but it’s fun!

  1. Go to a random page on Wikipedia. The heading is your band name.
  2. Select the last in a list of random quotations, or the last few words of it. That’s your album title.
  3. Take the third of a random selection of Flickr images. That’s your album art.
  4. Now get creative.

Trip Distribution

My random Wikipedia page is Trip distribution, part of a mathematical transportation forecasting model.

My random quote:

The deepest definition of youth is life as yet untouched by tragedy.

– Alfred North Whitehead
English mathematician & philosopher (1861 – 1947)

For my Flickr image i couldn’t take the third one because it was ‘All rights reserved’ so i kept going until i found one with a Creative Commons share and derive image. Which turned out to be this lovely picture: Hello flickr, (explored) by OUCHcharley.

Lack of a plan

I am waiting for some inspiration to occur to me about what to do for the rest of the afternoon. I know i have some chores to do (don’t i always?!) but not too many today. I might watch The Bill which my sweetie kindly recorded for me in the week. I might work on the MyChores API a little bit … or i might just continue lying in bed. Blogging from my bed is the best thing, haha!

I went to church again this morning. It was perfectly fine. I met a few more people, including many of the musicians. I keep dropping hints that i’d like to join their band, but i haven’t yet spoken to the people i would need to in order to join! I felt very content this week, and happy to be at the church. I love it that there are so many South Africans at the church. They are friendly and kind … and i love their accents! I’m probably going to pick up a bit of Afrikaans if i keep on going!

Work was good this week. I did a good job and i knew it. There’s no doubt that the work i’m doing now is the hardest i’ve ever had to do. I’m not used to finding my job difficult. But hey, it’s so rewarding to overcome a challenge and know i did it really well. I feel proud of myself. It’s tiring, though. I had a lovely relaxing day yesterday, but i still feel like i need a bit more time to relax before going into another busy week of hard work.

Yesterday afternoon was spent with nyecamden who came to Winchester to meet me. We had a good time together. Visited the library to have a go on their wifi with our netbooks! :) Went to my favourite cafe, The Sanctuary for a delicious hot chocolate. We walked down to the cathedral green to idly pass the time. On the way we found several messages written in chalk on the pavement of The Square. I don’t know who started it, but they were interesting to read. Many of them began with “This is …” and contained recollections of Winchester and happy memories.

Adding to the chalk messages

I added to the messages, with “This is my favourite place to live”. It’s true, i love Winchester. Such a beautiful city, steeped in history and culture. I am very happy to live here.

Thank you Nye for the picture! :)

Caught in a Storm

No, the title isn’t in reference to the current freaky weather we are having (though there have been many surprise storms this week!) but it is the title of a picture that has been drawn … for me! :)

I do like the twoseekers community on LiveJournal, dedicated to Harry and Cedric, my one true HP pairing! :) On Tuesday last week rotary phones posted, saying,

As a big thank you to everyone who made last month the Month of Harry and Cedric (TM), I’m making an offer: free art! That’s right. Make a request, and I’ll do my best to set my artistic talents to the task.

I was the lucky first to get my request in:

Oooohh! That is a wonderful offer, and i have just the perfect scene that i’ve always wanted a picture of.

You know in book 3, chapter 9, the Gryffindor/Hufflepuff match … thunderstorm, everyone drenched to the skin … and the Dementors … Harry fell 50 feet and Cedric caught the snitch. Well, i know that’s what happened in the book, but i’ve read a lot of fan fiction where Cedric actually caught Harry, and in my mind that’s almost become canon now, heheh!

I’d really like a picture of Cedric swooping in at the last moment and catching Harry. If you would like to oblige i would be most exceedingly thankful! :)

And here it is, a truly beautiful picture; the bold colour style reminds me of the covers of the French Harry Potter books …

Continue reading