Script to clean images by contrast manipulation