Sunday, November 30, 2014

My proposed logo for the European Go Federation

This is my entry into the European Go Federation's logo design contest.  Besides the logo, I'm presenting a 3D concept representing the core idea, and various levels of design for use in different settings.  I'm also presenting a few concept documents to show how the proposed logo would be used in practice.

If my design is selected, I am willing to work with the EGF and any external designers they might select to refine the design if required. For example, if the map of Europe is considered objectionable it can be removed or modified. I will also provide:
  • A blender file with the 3D design, to be used for derivative logos
  • Pictures of the full-colour view of the design at various resolutions, to be used on websites and on marketing materials
  • Inkscape SVG vector versions of the design with various levels of detail, down to simple line-art examples
  • Concept documents illustrating the use of the logo, which can be used by other designers to prepare stationery, business cards and promotional material.

The overall concept


The design features white go stones with the letters E, G, and F, partially surrounding a black go stone with a rough map of Europe.  Just below the black stone is a star point.  This is intentionally a simple layout. It incorporates the abbreviated name of the organisation, a depiction of the game of go, and a recognisable depiction of Europe.

For a more complete concept, the full name of the organisation can be included below the stones. Here is one possible rendering, with the map of Europe and the name of the organisation rendered in a brushed metallic texture:

Although not the logo itself, this 3D aspect of the design can be used on websites or incorporated into the design of trophies, or added to videos; here, for example, the 3D concept is overlaid onto a video of a real go-board:



From concept to logo

To develop a logo from this design, however, it needs to be simplified. Here are two stages of simplification.  First, a grayscale version with no background, black 2D text, and the goban's lines cropped to form a visually appealing shape:
This is closer to a logo, but it is still not very clear, and it is not yet suitable for use at small sizes, or on documents which are to be printed in black and white, photocopied, etc. For the next level of simplification, here is a version without the text, and with the go stones shown as black and white line-art objects:

Note that this logo will still be recognisable at low resolutions, and will be quite resistant to deterioration when photocopied. The background is transparent, but the white go-stones remain white.

Here is an example at extremely low resolution:

This is a 64x64 image, slightly cropped, and still the overall design is recognisable.

The full name of the Federation can be added at any position around the logo, depending on how it is used in a document.  For example, top right:
or bottom left:
The typeface that was selected for the logo (including the letters on the go-stones) is Crimson, a free and open-source font family that is in continuous development.  Crimson supports a wide range of European languages, including Greek and Russian. This means that it can be used to generate documents and designs that harmonise with the logo itself.

Use of the logo

Here are three examples of how the logo might be used in stationery:

Business cards



Game record sheets



Official letters

Saturday, November 29, 2014

Converting SVG files in bulk and parallelizing for loops


What I learned about Inkscape today: it's easy and quick to export files from the command line, and for testing purposes, it has a rather cool interactive command line mode, accessed by the command "inkscape --shell"

I found out about this by reading Inkscape's man page to find out how to export files from the command line.  There I found this:

--shell

With this parameter, Inkscape will enter an interactive command line shell mode. In this mode, you type in commands at the prompt and Inkscape executes them, without you having to run a new copy of Inkscape for each command. This feature is mostly useful for scripting and server uses: it adds no new capabilities but allows you to improve the speed and memory requirements of any script that repeatedly calls Inkscape to perform command line tasks (such as export or conversions). Each command in shell mode must be a complete valid Inkscape command line but without the Inkscape program name, for example "file.svg --export-pdf=file.pdf".


I also found out that to export the page area of a file to a pdf, I can use the command "inkscape file.svg --export-area-page --export-pdf=file.pdf". (or, a bit shorter, "inkscape file.svg -C -A=file.pdf").

OK, let's see how this works. First I pull my list of svg files into vim:

$ ls *svg | vim -

Then, in vim, I add the command line parameters to export the whole page to the respective pdf file, giving a list that I can copy and paste. That's a one-liner:

:%s/\(.*\).svg/\1.svg -C -A=\1.pdf/

In another xterm, I enter inkscape interactive mode and see this:

$ inkscape --shell
Inkscape 0.48.4 r9939 interactive shell mode. Type 'quit' to quit.
>


I paste the first command from my list and check that it works out OK. All good, so paste the rest and all my files are converted within a few seconds.  If I weren't curious and procrastinatory, I'd have stopped here, but now I want to know what other options I have for bulk export, and how they stack up against each other.

First test: just string them together on the command line. Back to vim, type "vipj" to gather all my commands into one line, add the magic words "time inkscape" to the start of the line and paste into bash:

$ time inkscape egflitetext.svg -C -A=egflitetext.pdf EGFLogoMonoPathsBusinessCard.svg -C -A=EGFLogoMonoPathsBusinessCard.pdf [etc. etc. - long command line snipped here]

real    0m3.298s
user    0m3.132s
sys     0m0.144s


So exporting 12 svgs to pdf took just over 3 seconds.  Not bad, but a bit clunky if I want do do this frequently. I spent some time trying to figure out how to make find or xargs generate this commandline, but I can't figure it out.  I could probably do it in sed, but for my purposes that's just a bit too conceptually complex, so instead I used this loop:

$ time (for i in *svg ; do inkscape $i -C -A=$i.pdf; done)

real    0m5.512s
user    0m5.080s
sys     0m0.412s


That's 67% slower, but much more convenient. But wait, I have a 4 core processor in my laptop, so why not let them all work at once? xargs can run jobs in parallel.

 $ time (find . -maxdepth 1 -name "*svg" -print0 | xargs -0 -P4 -I % inkscape % -C -A=%.pdf)

real    0m2.572s
user    0m8.360s
sys     0m0.460s


Wow, quite a lot quicker when we do things in parallel! But hang on, if I detach the jobs in the for loop, they'll also run in parallel.  Let's see how that performs:

$ time (for i in *svg ; do inkscape $i -C -A=$i.pdf & done)

real    0m0.007s
user    0m0.000s
sys     0m0.004s


Oh, right: these processes run as separate jobs, so their time isn't counted towards the total. Bright ideas to profile this are welcome! It felt really quick, and it's simpler to remember than the find | xargs solution, but of course if I had hundreds of files to convert instead of a dozen, it might lock up my system, so then xargs would be the way to go.

As we all know, Inkscape isn't the lightest svg converter out there: librsvg (based on the cairo library since 2005) has a utility called rsvg-convert which is specially built for this task. Let's give it a spin. For comparison, I'll run the jobs first in series and then in parallel:

$ time (for i in *svg ; do rsvg-convert $i -f pdf > $i.pdf; done)

real    0m2.976s
user    0m2.772s
sys     0m0.160s


$ time (find . -maxdepth 1 -name "*svg" -print0 | xargs -0 -P4 -I % rsvg-convert % -f pdf > %.pdf)
 

real    0m1.341s
user    0m4.460s
sys     0m0.208s


Even when called once for each file, the librsvg tool easily outperforms Inkscape called as a single instance.  These svgs were originally made in Inkscape, so librsvg isn't guaranteed to give the same output, but when I compared the results, the pdfs from Inkscape's export and rsvg-convert had almost exactly the same file size, and the only difference I could see in the pdfs was the scaling: in evince, when the two pdfs were the same size on the screen, they had different zoom levels.

Even though librsvg is faster, I'm going to keep using Inkscape: even though I couldn't spot any differences between the output files, I don't want to have to worry about it. This would be different if I were running a server.

Of course, in all my examples except the one with the long command line, the filenames end with .svg.pdf .  If I want to fix that, it's a simple matter of typing "rename -f 's/.svg//' *svg.pdf"

Relevant XKCD:





Monday, June 2, 2014

The Poet Laureate of Reddit meets the Artist Laureate

I hate bad poetry.

It makes me almost physically twitchy to have to read or listen to doggerel. The worst crime is when the poet pays no attention to rhythm or natural sentence structure, and does whatever is needed to force every two lines to match. You see this kind of thing on birthday cards, and you hear it at weddings, funerals and company events.

I don't mind blank verse when it's done well, with one of my key requirements being that if you just take out all the linebreaks, something of value has to have been lost, otherwise it's just pretentious formatting. I have a particular liking for well-done structured poetry, though.

The last place you'd expect to see good poetry is on reddit. Reddit is a discussion site where people vote each other's content up and down: content that tickles the "hive-mind" is given more exposure. It's essentially a rather ephemeral, and not particularly literary environment, but significantly better than most web-forums, because the worst stupidity gets filtered out.

There are certain Reddit users who are on a mission, however. Called "novelty accounts", most are stupid, and some are useful. One of Reddit's favourite novelty accounts is the user who goes by the name "Shitty_Watercolour". This user illustrates other Reddit users' comments whenever the whim strikes. Over the years the watercolours have become significantly less shitty, though. Reddit users consider being the subject of a "shitty watercolour" to be one of the highest honours available on the site. Another redditor with a mission is the topic of this article: Poem_for_your_sprog.

Poem for your sprog is actually a really good wordsmith. In response to a simple or profound comment sprog will produce an expertly crafted poem. Sometimes long, sometimes short. Sometimes coarse, sometimes decent. Almost always witty and brilliant, but sometimes just, well, good.  Here are two samples:

I sometimes think I see his face -
The man without a voice.
The man who walks another place,
Divided by a choice.
Perhaps he never made the same
Mistakes across the years -
He never felt an addict's shame
In broken pride and tears.
Perhaps he wed the perfect wife,
And sailed across the sea.
Perhaps he led a better life.
Who cares?
He isn't me.

That's better than most of the poetry I studied at school, and in fact it would not be out of place as assigned reading in a school classroom. This one probably would be, though:

I still recall our perfect start -
That single, precious line.
The moment that I had your heart,
And you, my dear, had mine.
You cupped my cheek and turned my head -
You whispered, 'darling, look.'
You leant in close and softly said...
'ey bb wan sum fuk?'

I try to limit my Reddit usage: I got badly addicted a while back, and have since deleted my account, so that I can only read, and not upvote, downvote or comment. This helps somewhat, but I still read now and again, and every time I see one of these poems, it brings a smile to my face.

Today I became aware that Shitty Watercolour illustrated the same comment that sprog had morphed into verse. The comment in question was this one:

Poverty stricken Uni student, at a supermarket, opened my handbag to pay at the register and a huge fucking moth flew out.
I swear the wing span on that bastard made a "thwock" "thwock" sound as it flew off

Not deeply profound, but it inspired this watercolour:
and this poem:

'Good day!' said I, as pleased as pie,
With overjoyed contented sigh -
'Oh what a shop! Oh what a store!
You've everything I need and more!
You've knicks and knacks and tricks and toys,
And souvenirs for girls and boys,
With gifts and games and trinkets too!
Just look! I filled my basket through!'
The shop-keep sighed: 'Whatever. Fine.
It's yours for $19.99.'
'I see,' said I, and shook my head...
'But all I've got is moths,' I said.

Not actually sprog's best poem, but still way above the normal level of web discourse. The main thing here was that two artists had met. Was it for the first time? I'm not sure - I haven't really investigated deeply enough, but I did find this in Shitty Watercolour's history:

In case that's too small to read, the poem is:
'Hey Mother Nature - what's the deal?
You know, it seems with every meal
I take a bite, then take a breath -
And always almost choke to death!'
Between the fallen leaves from trees
That spun upon a summer's breeze,
Her answer came - a sigh instead.
'Just try to fucking chew,' she said.

I think it's cool, well-written and funny, and yet written in an almost classical style. And the illustration is perfect.

In summary, those two should make a book.

I forgot to mention that Poem for your sprog has now started putting non-Reddit poems onto a blog: http://poemforyoursprog.wordpress.com/author/poemforyoursprog/