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

...other functions
Makes sense! Did not know about the in-place functionality of clip. Slightly rearranged your code.