implemented the error diffusion onto median cut algorithm