1 A computer-implemented method for automatically calibrating a masking process simulator, comprising the steps of: (a) performing a masking process using a calibration mask and process parameters to produce a calibration pattern on a wafer; (b) creating a digital image of the calibration pattern; (c) detecting edges of the pattern from the digital image using pattern recognition; (d) inputting data defining the calibration mask and the process parameters into a process simulator to produce an alim image estimating the calibration pattern that would be produced by the masking process; (e) overlaying the alim image and the detected edges of the digital image; (f) measuring a distance between contours of the pattern in the alim image and the detected edges; and (g) using one or more mathematical algorithms to iteratively change the values of the processing parameters input to the simulator until a set of processing parameter values are found that produces a minimum distance between the contours of the pattern in the alim image and the detected edges, thereby effectively calibrating the process simulator to compensate for process variations of the masking process.