Python code and notebook for basic image processing