3 bit Colour dithering!

After attempting a black and white version (https://hsel.co.uk/2014/09/03/floyd-steinbergesque-dithering-in-matlab/), I decided to further improve my algorithm through different methods. Currently, it uses a 3×3 macroblock size and white this works well for larger images and looks pretty cool, it doesn’t scale well with smaller images! For that reason, I’ve moved to a 2×2 macroblock size for the colour version of my algorithm. With the colour version, the images are composed using the same pixel density to brightness idea yet colours can either be 0 or 255 in brightness! This translates to a maximum of 8 colours being represented (2^3 = 8, 3 = red(1)+green(1)+blue(1)). Obviously, for those who have ever seen an 8 colour image, you can say it looks pretty damn poor! Infact, here is an example using my test landscape image:

The original picture, as per!

The same picture but representing colour with only 3bits per pixel.

Its not horrific but its definitely notably worse and isn’t particularly appealing to the eye unless that’s what you’re looking for! In fairness, the colour dithering isn’t quite as effective looking as the black and white dithering but its still cool. The same structure is followed in performing the algorithm, apart from the block size now being 2×2 instead of 3×3. Each colour channel is individually processed instead of in the black and white example where the sum of the channels is processed. This results in:

The freshly dithered image. It works much better at higher resolutions!

As you can see, the dithered version actually doesn’t look better in my opinion, it does however give the perception that more than 8 colours are used! On larger pictures, it does seem to work much better. With using only 2×2 blocks now, you can see the individual macroblocks a lot easier and you get some colour anomolies at times too. For those of you wondering what the same image looks like with rotation turned on:

Adding the matrix rotation after use functionality makes the image look much more unstructured and noisy.

The above version might be a nice effect for some people to use but since the dither matrices rotate independent of colour, you get whole macroblocks rotating out of sync with respect to colour. For example, if red uses the dith1 matrix of [0, 255; 0, 0], this will then be rotated to [0, 0; 0, 255]. If the blue channel then wanted this same matrix, its already been rotated and therefore the red and blue macroblock won’t be synchronised, placing a red and blue pixel next to each other instead of on top of eachother.

Regardless, progress is definite and i’ll continue improving my dithering functions, even if they’re only for a bit of fun!