linux/xsane scanned at 300 dpi, 16 bit, 412 * 278 color-3.jpg original infrared plane 0color-rgb.jpg original RGB image dirt removal images/steps 1clean-3.jpg infrared plane with reduced red component 2yen-threshold-3.jpg static threshold assuming bimodal histogram 2otsu-threshold-3.jpg static threshold presumed dirt is black, if yen shows less dirt than otsu dirt is not clearly separable by static means 2madmean-threshold-3.jpg adaptive threshold is combined with the yen static threshold to add large dirty areas 3dilate-rgb.jpg dirty pixels are replaced by the nearest clean pixels only replaced pixels are mean filtered 4gamma-rgb.jpg applied gamma 0.4545 for natural appearance