Implements #289 fix for bad colours
For bad colours, take an average of neighbouring colours. Currently this is a single non-weighted average of all non-bad neighbour colours. It seems visually fine although a weighted average may be technically better.