max size in thresholding