Image Processing In Python Code For Snakes