1. A computer-implemented method for obtaining a black point and a white point for a digital image, comprising the steps of: partitioning the digital image into image blocks; classifying each of the image blocks as valid if a given image block has a total number of relatively black pixels exceeding a first predetermined threshold and a total number of relatively white pixels exceeding a second predetermined threshold, wherein a relatively black pixel is defined as a pixel whose color component values are each less than a predetermined black pixel threshold and a relatively white pixel is defined as a pixel whose color component values are each greater than a predetermined white pixel threshold; clustering the relatively black pixels of the valid image blocks into at least one black cluster and the relatively white pixels of the valid image blocks into at least one white cluster, each black cluster having a black cluster centroid and each white cluster having a white cluster centroid, wherein a current centroid of a first black cluster is set to color component values of a first relatively black pixel, a current centroid of a first white cluster is set to color component values of a first relatively white pixel, and color component values of a selected untested pixel are compared with the color component values of each of the current centroids of the first black and white clusters to determine if the selected pixel belongs to the first black cluster, the first white cluster or a new cluster, wherein as a new pixel is added to an existing cluster new centroid color component values are calculated for the existing cluster based on the existing cluster's current centroid color component values and color component values of the new pixel, there being at least three color component values for each pixel and each centroid; and selecting one of the black cluster centroids according to a first predetermined set of rules to be a black point of the digital image and one of the white cluster centroids according to a second predetermined set of rules to be a white point of the digital image.