Thresholding is a common image processing operation applied to gray-scale images to obtain binary or multilevel images. Traditionally, one of two approaches is used: global or locally adaptive processing. However, each of these approaches has a disadvantage: the global approach neglects local information, and the locally adaptive approach neglects global information. A thresholding method is described here that is global in approach, but uses a measure of local information, namely connectivity. Thresholds are found at the intensity levels that best preserve the connectivity of regions within the image. Thus, this method has advantages of both global and locally adaptive approaches. This method is applied here to document images. Experimental comparisons against other thresholding methods show that the connectivity-preserving method yields much improved results. On binary images, this method has been shown to improve subsequent OCR recognition rates from about 95% to 97,5%. More importantly, the new method has been shown to reduce the number of binarization failures (where text is so poorly binarized as to be totally unrecognizable by a commercial OCR system) from 33% to 6% on difficult images. For multilevel document images, as well, the results show similar improvement.