Python Threshold Image Converter