Returns a function to access pixel values by x,y