An iterative method is proposed for the sharpening of programmable filters in a 4-f optical correlator. Continuously variable spatial light modulators (SLMs) permit the fine adjustment of optical processing filters so as to compensate for the departures from ideal behavior of a real optical system. Although motivated by the development of continuously variable phase-only SLMs, the proposed sharpening method is also applicable to amplitude modulators and, with appropriate adjustments, to binary modulators as well. A computer simulation is presented that illustrates the potential effectiveness of the method: an image is placed on the input to the correlator, and its corresponding phase-only filter is adjusted (allowed to relax) so as to produce a progressively brighter and more centralized peak in the correlation plane. The technique is highly robust against the form of the system's departure from ideal behavior.