Sample implementation for different common dithering algorithms