Create threshold.py

For image thresholding