An apparatus and method for improving image quality in a photolithographic
process includes calculating a figure-of-demerit for a photolithographic
mask function and then adjusting said photolithographic mask function to
reduce the figure of demerit.