In this paper, we present a new and automated technique to extract defects in photomask images. To correctly extract defects, we propose a robust automated method based on second order moment (SOM) between reference and test images and a statistical model based on difference image are used. The statistical model is distribution of the normalized absolute difference value (ADV) between reference and test image that divided by a maximum value of ADV. In our algorithm, the photomask images: transmitted reference, test image pair and reflected images pair are compared and used to get acceptable results. The SOM shows a wide range of selectable threshold values and the statistics model reduces interference element. Together, these methods improve defect extraction. Our proposed algorithm guaranteed accurate extraction of defects.