Returns a function that sets pixel values