Dithering - 17/12/19

Back to Main Page

I was recently watching a video by Lucas Pope about his hit game, Return of The Obra Dinn, and I was reminded of the dithering effect that is used throughout the game. Pope only used 1-bit colour, meaning that each pixel can either be off or on, but nothing in between. Usually this would create a flat, boring effect, but he used dithering to make it more closely represent the shades in the game.

For a more in-depth explanation, here is a good video by Computerphile:

I thought that it would be good to know some more about this effect, so I started out by coding a simple demo in python. I generated a gradient, and used a 2x2 bayer matrix to dither it, which resulted in this picture:

Dithering applied to a gradient

This was exactly the effect I was after, so I started moving onto loading images, and applying different bayer matrices to them.

I started off by finding a picture to apply the effects, and decided on this picture of the grand canyon (Taken by Murray Foubister):

Grand Canyon

Then, I applied 3 different bayer matrices, 2x2, 3x3 and 4x4. These are the results:

Grand Canyon Grand Canyon Grand Canyon

While they were dithered, and should only use 2 colours, I resized them afterwards, so they may contain other shades of grey. Your web browser may also make the images appear too bright, depending on how it is scaling the images. The original, unscaled versions can be found by clicking on them.

While dithering with just black and white is nice, it would also be cool to have them in full colour. So, with a slight modification, I added colour support:

Grand Canyon

You can download the code here, and you will need PIL to run it.

Back to Main Page