A programmable optical associative memory for two-dimensional image retrieval is described. Both the stored images and the input image are displayed spatially; therefore, they can be updated in real time more conveniently. The integral product between the input image and the stored images is obtained by a nonlinear correlation technique that has a superior performance compared with conventional optical correlation techniques in the areas of light efficiency, correlation peak to sidelobe ratio, and correlation spot size. Thus, better quality images can be reconstructed, and the need for optical gain and optical feedback may be eliminated. The losses in the system are small since no holograms are employed.