Computation with images and Python