added line to stretch pixel range after thresholding