1. A method for generating a three-dimensional dither matrix for use in representing one or more color levels in an image, wherein the method comprises: receiving data representing a three-dimensional array of pixels, wherein each pixel has a value and each pixel is assigned based on its value either to a first set comprising cluster pixels arranged in clusters or to a second set comprising void pixels arranged in voids; defining a three-dimensional dither matrix comprising a plurality of elements, wherein each pixel within the array has a corresponding element in the dither matrix; determining a value for each element in the dither matrix that corresponds to a cluster pixel by identifying a cluster pixel located in a largest cluster within the array, updating a rank value that indicates an order in which the cluster pixels are identified, generating a value for the corresponding element in the dither matrix based on the rank value, and removing the cluster pixel from the first set; and determining a value for each element in the dither matrix that corresponds to a void pixel by identifying a void pixel located in a largest void within the array, updating a rank value that indicates an order in which void pixels are identified, generating a value for the corresponding element in the dither matrix based on the rank value, and removing the void pixel from the second set.