1. A method of optimizing a light source to create a desired pattern of features on a wafer with a photolithographic process, comprising: receiving at least a portion of a layout database and selecting a desired pattern of features to be created on a wafer; relating a number of pixel intensities in a light source and the contribution of the pixels in the light source to a point on the wafer to the desired pattern of features using a mathematical relationship; and determining the pixel intensities of the light source using the mathematical relationship such that upon simultaneous illumination of the pixels at their determined pixel intensities, the errors between a pattern of features that will be created on the wafer and the desired pattern of features are minimized.