A generalisation of the error diffusion method for binary computer generated hologram design