2011-01-15

2011-01-15 - More Dithering

Moving on from the success of Parrot dithering, I decided to run a few more tests on the quantising/dithering engine to see what kind of effects I could get out of it.  I modified the drawing routine to allow a half-dithered option where the error value is divided by two so that only half the error is applied to the following pixel.  Also adjusted the calling code to then draw three parrots with the three forms of dithering, none, half and full.  The half-dithered approach did work to soften some of the artefacts from the crude dithering in some cases, but also ruined the effect in others.

The next thing I wanted to do was to see what effect changing the palette would have on the quantiser/ditherer.  First thing I tried was a grey scale of 0x000000, 0x111111 up to 0xFFFFFF.  This worked well and gave a very striking result, except for the anticipated fact that the greens looked dark and the blues looked bright.  Also of note was that the non-dithered version looked considerably better than the dithered version as the dithering artefacts destroyed the image.  It's possible that a Floyd-Steinberg dithering will improve this as each row will influence the following one.

Following on from this, I used a commercial paint package to calculate a 16-colour palette from the source image so that I could set the VGA palette to this.  With the optimised palette in hand, I couldn't resist setting only the red colour into the palette ... the result was impressive.  Most of the parrot was highlighted in red, with the entire background in shades of grey, very satisfying.

I implemented the full optimised palette, but the result didn't seem much better than my original palette, probably because the original palette was chosen to give a wide spread of colours in the available depth.

I then tried some different images, the OS logo (not released yet :P ), and two random images from the internet.  All the images worked really well, especially the colourful logo.

No comments:

Post a Comment