Clip to min and max range of input image, add missing clip parameter to ...

...other functions
@ahojnnes even though this is a private function, could you write a proper docstring for it? It really helps maintenance. In particular, I think it's very important to say that the clipping happens *in-place* in `output_image`. And that `clip` is a bool. etc.