1. A method comprising: computing and storing a first integral image representation of a grayscale image using a first number of bits per pixel; computing and storing a second integral image representation of the grayscale image using a second number of bits per pixel; executing an image processing algorithm on the grayscale image; determining the size of a window to be used by the image processing algorithm; and determining whether to use the first integral image representation or second integral image representation for the image processing algorithm based on the size of the window to be used by the image processing algorithm.