recolorize2 function

Recolorize with automatic thresholding