1. A computer-implemented method, comprising: quantizing each color channel for a region of an n-channel digital image to determine m representative values for each of the n color channels; generating an m n adaptive lookup table for the region, wherein each entry in the lookup table corresponds to a different combination of the representative values from the n color channels; and for each pixel in the region: for each color channel, determining a closest representative value to the value of the color channel for the pixel from among the m representative values of the color channel; locating an entry in the adaptive lookup table according to the n determined closest representative values for this pixel, wherein the located entry corresponds to the n determined closest representative values for this pixel; determining a metric for this pixel according to the located entry in the adaptive lookup table; and outputting the determined metric for this pixel.