In my last post I talked about ordered dithering, and how it compared to the error diffusion technique I had implemented previously. After successfully implementing ordered dithering the natural next step was to incorporate the ordered dithering into my BBC Micro Mode 2 image filter so that all the image processing techniques were available in one filter.
Whilst doing this, I also made the Strength slider in my BBC Micro filter act upon Ordered Dithering as well as Error Diffusion. This allows for some quite interesting effects.
Here is John Liven’s Somerset cottage picture. I’ve applied Ordered Dithering with a 2×2 threshold matrix set to 100% strength:
And here is the same picture with the same dithering applied at just 50% strength:
Once this was done the BBC Micro Mode 2 filter was finally finished off. I then turned my attention to writing a BBC Micro Mode 5 filter. Mode 5 is very similar to Mode 2, but you can only use 4 colours from a selection of 8.
This means the image filter needs an additional step in which the palette to use for the image is selected. The way I approached this was to scan the entire image pixel by pixel tallying which of the 8 possible BBC Micro colours each pixel was closest to. Then, I simply used the four most commonly found colours.
Incidentally, the way you work out how close one colour is to another is quite simple once it’s explained to you: I found the answer here.
After a coding a bit of Python I loaded an image of some parrots into The GIMP:
And tried out the filter with no dithering. It worked first time:
And when some Sierra3 error diffusion was added too, the results were incredibly good:
I still can’t get over the fact that there are just four colours (black, white, red and green) in this image.
With a Mode 5 filter under my belt it was very easy to produce a Mode 1 filter. Mode 1 is the same as Mode 5, but has square pixels:
And a Mode 4 filter. Mode 4 is like Mode 1, but is restricted to just two colours:
So, I have got a pretty nice suite of BBC Micro image filters, with only Mode 0 to add. As always, you can download them from here. Microsoft Windows users can find out how to install and use the filters with The GIMP by following the very nice set of instructions with pictures I’ve found here.