Karmic Tablets…

I’ve wanted a graphics tablet ever since I watched a pretentious little series on BBC2 (Painting With Light, 1987) where artists such as David Hockney were given the Quantel Paintbox to play with for an afternoon. They all produced a load of bobbins, but it looked such fun.

My interest was rekindled when a former colleague of mine, the multi-talented artist David “Peanut” Paramore used to bring a graphics tablet in to work with him a few years ago. The sort of work he produced with it was (and is) incredible and I really wanted to have a go at using a tablet for myself.

So, for Christmas this year, I was delighted to finally receive a Trust TB 5300 graphics tablet.  Even after I asked my parents for this, I wasn’t actually sure I’d be able to use the thing with GNU/Linux. I had visions of having to take a crash course in C and X programming in order to get the thing to work.

I needn’t have worried – the nice thing about the GNU/Linux world is that its users tend to blog about getting unusual bits and bobs working on the operating system, and this was no exception.

A blog called “Dick’s Open Source Life“, which is written by Dick Thomas, came to my rescue and thanks to this blog post I have the Trust TB 5300 working on Ubuntu Karmic Koala very happily indeed.

Both Inkscape and The GIMP work fine; even pressure sensitivity functioning as expected. I didn’t even need to callibrate the tablet as it worked fine out of the box.

In fact, the tablet even works properly when I’m running Macromedia Flash 8 via WINE.

Thanks once again for your help Dick!

Hey Jemima let’s go popping….

Having got heartily fed up of Ubuntu GNU/Linux snap, crackling and popping at me at the slightest provocation, I ended up looking for a solution. After a quick Google I found the answer. It turns out I’m having this audio issue because Ubuntu is utilising a power saving “feature” of Intel integrated sound hardware.

At the command line, if you type:

gksu gedit /etc/modprobe.d/alsa-base.conf

And then comment out the following line in the gedit window that appears by putting a hash (#) symbol in front of it:

options snd-hda-intel power_save=10 power_save_controller=N

You’ll find that, after a reboot, there’s no more popping.

I’ve also finally discovered a music player program for GNU/Linux that does exactly what I want. It’s called Quod Libet, and comes with an excellent piece of tagging software called Ex Falso.

What exquisite taste this man has.

I’ve found it to be utterly fantastic for people like me who like to organise and tag their music to an inch of its life.

Watching DVDs on Ubuntu

Many moons ago I published a post about my problems in playing DVDs in Ubuntu GNU/Linux. The main problem was that I simply couldn’t. Which is quite a big problem, particularly for me.

Well, now I can without going through the hoops I posted about last time. Thanks to the updated version of the Linux kernal found in the latest version of Ubuntu, the fix for UDF now actually works. To apply it you need to change a file you find in

/etc/fstab

You need root privileges to write to this file, so to get them I opened it up in the gedit Text Editor using the sudo command.

sudo /usr/bin/gedit /etc/fstab

Then I commented out the line that read:

/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0

By putting a hash (#) symbol in front of it and then added a line underneath it that read:

/dev/scd0 /media/cdrom0 udf,iso9660 users,noauto,uid=0,gid=46,mode=0777,dmode=0777,nosuid,noexec 0 0

This should be all one line. Once that is done, video DVDs will actually mount, and you can actually play them.

Now I can watch DVDs just like this one!

I had another problem with video in Ubuntu, and that was Totem never seems to be able to work out the duration of a VOB or MPG video file. It thinks no MPG file is longer than about 24 seconds. Mind you, that’s about four times the average attention span these days, which is probably why the bug hasn’t been picked up yet.

I fixed this by the simple expedient of installing the excellent free software media player VLC. It particularly excels with video, and allows me to have lovely jittery interlaced fields using the Video -> Deinterlace -> Linear option.

Anyone for a Ketamined Kangaroo?

I’m a big fan of free software in general and the GNU/Linux operating system in particular. The first distribution or “distro” of GNU/Linux I ever tried was Ubuntu, and being a huge fan of brown and orange it’s the version I’m still using on my computer to this day.

I like free software because even though I don’t have time to write many programs these days, I like fiddling with software and I like sharing software with my friends, and free software positively encourages you to do both.

GNU/Linux is also a natural choice in our household as it’s multilingual – it allows us all to run the operating system and applications in whatever language that suits us whenever it suits us.

Recently I’ve been testing the Beta and Release Candidates of the latest version of Ubuntu – version 9.10 or “Karmic Koala” as it’s known. As you read this I hope to be sat in front of the full release version.

I’ve noticed that there is a new feature that makes my life a lot easier in Karmic, and that is the font previews you get in the Nautilus file browser.

Font previews in Nautilus – invaluable

This is a lovely feature and saves me hours of work in an average week when I’m hunting for a font I’ve forgotten the name of out of a collection of thousands.

For those of a typographical persuasion there is also an excellent article about using fonts on Ubuntu here.

If you’ve never tried GNU/Linux, doing so – even for just an hour or two – is easier than ever and I do recommend you give it a whirl.

A Shower of Shot

Now I’d produced my “Monkhouse” font, my next job was to produce a caption using it. The Monkhouse font needs to be used very large to be legible, so the ATV graphic designers merged the letters together to give themselves enough room.

I also love the fact that the words are not centred.

I looked at the example above and noticed that the outer two outlines were fused together. By putting my letters over the ones in the screen-grab I worked out that the fourth outline of each letter should overlap the third outline of the letter to its left.

To do this letter fusing I used Inkscape and the letter outlines I’d drawn to import into FontForge. I used them rather than the true-type font simply because they were already the right size. I did this fusing a letter at a time, left to right. First of all I’d overlap the letters.

Overlap the letters

Then I’d merge the two outer outlines using the Inkscape Path Union feature. After that I deleted the areas of the merged path I didn’t want. The quickest way to do this was simply to draw a rectangle over an area of the overlap…

Rectangle over the overlap

…and then use the Path Difference feature….

Path Difference

…and then tidy up the paths using the Nodes tool.

And Bob’s Your Uncle

Then I’d do the same thing again for the second outline in.

Here’s the finished caption in Inkscape:

The end result.

After Rory OK-ed the end result he asked if I wanted to have a go at animating a title sequence for him. I said I would, provided I could get Macromedia Flash 8 to behave on Ubuntu GNU/Linux (I don’t have a copy of Windows). WINE is a very clever piece of free software that allows programs written for Microsoft Windows family of operating systems to run on the GNU/Linux operating system.

I already had WINE installed so I tried installing my copy of Macromedia Flash 8 and it worked perfectly. The only problem was the lack of anti-aliasing on some of the smaller fonts used on the interface and some of the keyboard short-cuts I liked using not working.

The next problem I had was how to export my Inkscape design into Flash. After doing a few tests the best format to use for the Inkscape to Flash 8 transfer seemed to be Encapsulated Postscript or “.eps”.

Now I was sure I could do something useful in Flash I got back to Rory and asked him which music he wanted to use. Rory quite rightly sent me back a copy of the late sixties/early seventies theme that was used for the longest amount of time. However, there was something missing – I wanted the “left a bit, right a bit, fire” that I remembered from my childhood. I suggested Rory cull it from the start of the final season’s title sequence.

I wanted to include this because I wanted to add the iconic ATV Colour Zoom logo at start of the sequence and have Bob smash it to pieces with a crossbow.

First of all I traced the bolt and bow from the final season titles – this was a very easy job as the shapes were quite simple. I layered a few gradient fills on top of each other to get a kind of “airbrushed” effect.

Running on GNU/Linux? That’s Flash…

Then I needed to smash the ATV logo to pieces. The first thing I needed to do was break apart my ATV logo in Flash so that it was all one symbol on one layer with no groups. Then I drew a “crack” shape on top of it. Finally, I turned the pieces inside each bit of the “crack” into separate symbol so I could animate them.

Lady Plowden did this too…

Although it’s very simple it worked quite well. As far as the titles themselves were concerned I wanted to copy the final season titles with the bolt setting off on a journey with concentric rings of airbrushed items giving an impression of movement.

This is what I wanted to copy…

One of the items I needed to borrow from those original titles was, naturally, an apple. Tracing the apple in Flash was an absolutely horrible job, and reminded me how lucky I am to be able to draw things in Inkscape most of the time. I decided not to draw the apple in Inkscape as I had no way of getting the gradient fills from Inkscape into Flash – they come across as bitmaps in all the formats I tried. This was no good as all of the objects I drew had to change size dramatically in the finished animation so they really had to be totally vector shapes.

Looks sweet, but rotten to do.

If you’ve never watched “The Golden Shot” you may not know that over the theme music an announcer says “…Live, from Birmingham…”. To illustrate the “from Birmingham” part I wanted a ring of ATV logos to appear. That was simplicity itself. But for the “…Live…” part I wanted to show the reason for the program being live – a telephone. “The Golden Shot” was a program where viewers at home could phone in and play.

In the later seasons of “The Golden Shot” a gold plated Trimphone was used, and I just had to have a trimphone in the titles as they are the essence of Britain in the seventies. I found a website with pictures of trimphones and I’m sure you’ll be delighted to know the trimphone I used as reference material was one of the series designed by Lord Snowden.

Something beginning with T: Trimphone – lovely!!!!!

Finally, I wanted to have a postcard, as viewers writing-in was an important part of the programme too. I used my Queen’s head and stamp perforations I’d designed many moons ago to use on a recreation of an ITV Schools and Colleges interval transparency. Anyone familiar with Bob’s life story will understand the significance of what’s actually written on the card.

And I want them served on that nice silver cake stand…

Sadly I currently don’t have access to the fantastic Swift3D here in England – I left my serial number in the UK and you can’t export without it. If I had, I would have used it to realise one of Rory’s original concepts for the title sequence.

What he asked me to do was to make the “O” rotate when it is hit by a crossbow bolt so that it looked like an “i” when it was on its edge so we got a shit/shot gag on the main title card. In fact, if I had had Swift3D I would also have recreated the wonderful psychedelic silver tube effect from the 1972 title sequence as well – it truly has to be seen to be believed.

Anchor but, er…

After shamelessly plugging my ANCHOR typeface on the web forum of The Mausoleum Club, I was delighted that it sparked off a very interesting conversation.

However one user going by the name of Boblet commented, quite correctly:

Dave…hang on, isn’t there supposed to be a rectangular block as one of the characters? How am I supposed to recreate Mentalis’ countdown sequence from The Armageddon Factor now? 🙂
http://www.mausoleumclubforum.org.uk/ Retrieved 29 September 2009

The problem was that I hadn’t seen the BBC Engineering Monograph 84 that shows a selection of ANCHOR characters when I originally created the font back in 2006, so I didn’t know I needed to add a block character.

With blocks you can do thrilling things like this!

As I thought it was only going to be a five minute job (if only I’d have known…) I thought I’d add one. What I needed to do should have been very simple: add a solid black rectangle to the Unicode character position known as “U+2588 FULL BLOCK”.

I originally created the font in Fontographer, but I’m using FontForge these days – I don’t even have my copy of Fontographer in the country! I had my .fog file from when I originally created the font in Fontgrapher, but FontForge can’t do anything with these. Luckily I could load in my .ttf into FontForge and answer angelically in the affirmative when it asked me very sternly if I really had permission to play with the typeface.

However, whenever I scrolled down to alter FULL BLOCK FontForge crashed every time. It simply disappeared in a puff of smoke without any warning or error whatsoever. My version of FontForge from the Ubuntu repository was well nearly 18 months old, which is an age for a program under constant development. Font Forge is worked on so much its version numbers are given as dates and times.

So I decided to so something quite drastic – I’d download a source tarball of FontForge from Sourceforge and compile and build the very latest version from the source. As I am using Ubuntu Linux this sort of thing is very easy. In theory, anyway…

Because I use IDLE and Python regularly I had all the odds and ends installed that I needed to compile something from source. According to the instructions, I just needed to type four commands on the command line and I’d be finished.

Stunningly, it all worked beautifully and I now have a shiny new latest model version of FontForge – a mere baby at only six days old when I downloaded it.

Fresh as a daisy – only six days old

And, as an added bonus, the user interface now looks like it was created in 2003 instead of 1986. Although still rather black and white, it is all anti-aliased and looking very pretty.

The interface is looking much more modern

Adding the block character to Anchor took ten blissful crash-free seconds and I have now uploaded the latest version of the font, version 4, to here.

Using my Python GIMP plug-ins on Microsoft Windows

I was recently asked how to install my VHS and PAL filter plug-ins for The GIMP on a computer running Microsoft Windows.

There are lots of ways to do this. In my view the best way is to download and burn a CD of Ubuntu Linux and install it on your computer – for those not wanting to do scary sounding things like repartitioning their hard drives you can use a lovely little thing on the CD called Wubi which can put the whole of Ubuntu Linux in just one file on your computer. This means that if you don’t like it you can get rid of it completely very easily. It runs very nicely and won’t interfere with Microsoft Windows at all. Ubuntu is a good choice as both The GIMP and Python are installed by default and ready to use from the moment you see the desktop.

Sadly, not everyone wants to try this, and for them I managed to find a good explanation of what you need to do here. I’ve summarised the important bit below:

What do I need to do to get Python scripts to work?

You have to install Python (as of GIMP 2.6.4, both Python 2.5 and 2.6 are supported), PyCairo, PyGObject and PyGTK.

If you haven’t installed The GIMP yet, install these files first.

If you installed GIMP before installing Python, PyCairo, PyGObject and
PyGTK, run the GIMP installer again to install the GIMP Python components.

After you have installed The GIMP with the other other bits and pieces, to install a Python plug-in on The GIMP:

  1. Shut down The GIMP
  2. Copy the plug-in files to ~/.gimp2.6/plug-ins (where ~ is %USERPROFILE% – probably in My Documents somewhere – do a search for a folder called gimp2.6)
  3. Restart The GIMP

On a GNU/Linux computer all you need to do is copy the files to the plug-ins folder as all other gubbins are installed and ready by default.

Filter tips (no Alistair)

I was bored of repeatedly applying my PAL and VHS effects to images by hand. It was a several stage process and rather fiddly: I desperately wanted to automate it. I knew it was possible to extend The GIMP by writing your own features in Python, so I decided to have a go and see how I got on.

The documentation for writing plug-ins in Python for The GIMP was pretty well hidden, but eventually I found it here. It was well written, very easy to follow, but it looked very old. For safety’s sake I felt I needed to have a hunt around and see if there were any more recent examples of filters for the GIMP in Python I could find just in case anything had changed. The tutorial seemed to have been written for The GIMP 1.5 but on my computer I’m currently using The GIMP 2.6.

Although I did try Google, the best example of Python filters for the latest version of Python were installed with The GIMP itself and sitting in:

/usr/lib/gimp/2.0/plug-ins

Sure enough, the filters in there that shipped with The GIMP 2.6 had a much better way of preserving The GIMP’s state before and after the filter is applied and help undo to work and also contained the gettext function that ensures your filter can be translated into other languages. There is also a slightly changed way of specifying which menu the plug-ins show up in in The GIMP.

Writing the plug-in itself was very easy indeed. No stretching, no unpleasant bending and the gedit text editor that comes with the GNOME desktop on Ubuntu GNU/Linux was all the equipment I needed.

Writing filter in gedit

I found using the Browse… button on the Python-Fu console in The GIMP was extremely handy. It brings up a Procedure Browser which I used for finding the functions I wanted to call and their syntax. It also showed me the constants I could use, which greatly reduced the number of “magic numbers” in my code.

Procedure Browser from Python-Fu console

The basic idea is that anything you can do in The GIMP with a mouse has a matching pdb (procedure database) function, so it’s really easy to write a macro-style filters – you just find the right function using Browse.. from the Python-Fu console and string them together. But as that because Python is a ridiculously easy language, it’s possible to do so much more than that. One thing I didn’t expect is that pdb functions sometimes have extra parameters that you can’t normally access using The GIMP itself.

The second part of your filter is a call to a function called “register” in which you specify the interface for your filter, its description and where you want it to appear in the application.

A filter’s interface is specified in its register function

The main problem I had was not writing the filters themselves but getting them to show up in The GIMP’s menu of filters. Firstly I needed to work out where to put the filters – with Ubuntu Linux the best place is in your home directory under .gimp-2.6/plug-ins.

But putting it in the right place wasn’t enough – there were two other issues. First, if you don’t set your Python scripts to “Allow executing file as program” they won’t show up in The GIMP. No warning, no nothing – if you forget to do that you just won’t see them.

Don’t forget to allow your filter to execute as a program

Secondly, you have to prefix your filter name with “python-fu-“, or again it will silently refuse to show up.

Once I did get the filter to appear and, better than that, it worked, it was an amazing feeling of achievement. It’s tremendously satisfying to customise a program to do some special things that you want it to do.

Success at last – click to enlarge

I’ve released both filters under the GPL v3, and they’re available to download from here.

Reliving my misspent youth…

Whereas my BBC Micro and Master 128 are as reliable as ever (whenever I get the chance to go to the UK to use them) my A3000 has long since given up the ghost. It’s a real shame as I loved it just as much as my Beeb at the time.

However, thanks to a job I’m about to do for Retro Software I tried to fire up Tom Walker’s Windows binary of Arculator on Ubuntu Linux under WINE. I had simply assumed before that it wouldn’t work – how wrong can you be, it works beautifully:

It’s an odd feeling to use this desktop again after so long

I have just as much old stuff languishing on 3.5″ floppy for the Archimedes as I have for the BBC Micro – Repton 3 screen designs, test cards and bits of presentation in !Draw format, programs including a rather nice version of Minesweeper I wrote in BBC Basic, some programs I wrote in ARM assembler and so on.

I am also now longing to play the original Archimedes version of Repton 2 again. Hopefully when I get back to the UK I’ll be able to transfer some of these discs over so I can use them on Arculator.

Repton: The Lost Realms loading screen

After I created the artwork for “Repton: The Lost Realms“, Dave Moore of Retro Software asked me if I would create a loading screen for the BBC Micro and Acorn Electron versions of the game. Initially the brief was quite loose – he thought we needed a Mode 5 screen for the cassette versions and a Mode 1 screen for the disc versions.

My cover artwork for Repton: The Lost Realms

On a BBC Micro or Electron, Mode 1 and Mode 5 are both four colour screen modes. The difference is that in Mode 1 the resolution is 320 x 256, whereas in Mode 5 the resolution is 160 x 256. However, both images are the same size because in Mode 5 the pixels are twice as wide as they are high. Due to its lower resolution, Mode 5 uses half the memory of Mode 1 so will load far more quickly for those using cassette recorders.

My first thought was to create the Mode 1 screen, and to use the excellent BBC Micro Image Converter software by Francis G Loch. This is an application written in PureBasic that takes image files (bmp, jpg, etc.) and downconverts them into the native screen display formats of the BBC Micro. To aid you in doing this it offers an almost bewildering array of image processing options specifically tailored for getting modern images into BBC Micro format. It can  also takes BBC Micro screen dumps and convert them to modern image formats.

BBC Micro Image Converter copes with anything

I use Ubuntu Linux, which means I have to run the Windows binary of the BBC Image Converter under WINE. I’ve found the operation of the program under WINE to be problematic if you don’t export import and output images from and to the WINE “C:Program Files” folder. It also seems happier with being fed bmp files than pngs under WINE.

Inspired by Michael “Mic” Hutchinson’s excellent loading screen for the disc version of Repton Inifinity, I decided to use the same Red, Black, White Green palette. I was very pleased by my early results – particularly the way the brown came out on the safe. However I hadn’t left any room for branding and so on.

My first try in BBC Image Converter

So I decided to create a version that had an area at the bottom that could be removed in the same way as the version on Repton Infinity disc for loading messages etc.

My rejected disc loading screen

I showed Dave this version and he had a number of reservations – the main one being that the loading screen in Mode 1 didn’t really grab him at all. He wanted something more colourful for the disc version, and he suggested trying Mode 2. Mode 2 is identical to Mode 5, apart from the fact you can use eight colours.

The first thing I did was to create a screen in Inkscape that was 320 x 256 pixels that was set out exactly as I wanted to my loading screen to look. I would use this to feed into the BBC Micro Image Converter.

The image I made to feed into the BBC Micro Image Converter

When I imported it, the results were excellent. In fact, the results were too good. Although obviously I needed to retouch here and there to tidy up the writing and the balloon strings I was overwhelmed by the feeling that really I should be producing something that was done by hand on a pixel editor – not put through some ingenious image processing we could only dream of in 1987.

All it needs now is for me to make it a bit rubbish

Therefore I fired up “The GIMP” and tried to add a sort of “hand designed” feel a pixel at a time. I was quite aware that what I was doing wasn’t as good as what the BBC Image Converter could produce, but the idea was to get a “retro” feel.

Final image after I gave it a “hand made” feel in The GIMP

I showed Dave Moore and he was happy with the Mode 2 screen, so the next job was to produce the cassette loading screen in Mode 5.

When it came to creating a Mode 5 screen, I decided to convert the eight colour Mode 2 screen to a four colour Mode 5 screen by hand, instead of running through the BBC Image Convertor again. This was because I wanted to keep the two loading screens as close as possible to each other in appearance.

I reduced the colour depth by hand in The GIMP

Dave was happy, so that was my first two loading screens for Retro Software done and dusted.

Repton: The Lost Realms is under development by Retro Software. Repton name used by permission of Superior Interactive.

The BBC Image Converter is currently released under a non-free licence but it’s free as in beer to use for commercial or non commercial uses. You can look at a number of the PureBasic routines Francis wrote for it here.