functional image processing in python