Enhancing image visibility with adaptive thresholding