Accidently came accross post Image Dithering: Eleven Algorithms and Source Code. Now I understand how dithering works.