Local images of photolithographic masks are assigned to classes based on similarity
of functions of circuits formed by the images, so that all of the images of a class
can be corrected by correcting one of the members. Boundaries of photolithographic
masks are corrected for diffusion of light by moving regions based on process light
intensity and proximity of close connections. Boundaries are also corrected for
shifting of photoactive material in photoresists by calculating the amount of shift
based on light intensities at pattern points.