1. A computer implemented method for adaptive binarization to remove a defect from an image, the method comprising: receiving image data; grouping the image data into a plurality of components, wherein each of the components comprises a plurality of bit groupings; identifying, in the plurality of components, at least a first data type and a second data type; and processing the plurality of components to remove the at least one defect, wherein each bit group of the first data type is compared to a first threshold value and the bit group is set to a first color value if the number exceeds the first threshold value and the bit group is set to a second color value if the number does not exceed the first threshold value.