An optical element, such as a lightguide or an optical film, is formed with
a predetermined, programmed pattern of optical structures. The optical
structures may be arranged to selectively correct for non-uniformities in
the output a lightguide, or may be arranged to otherwise enhance the
performance of a display.