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: