A programmable optical associative memory for two-dimensional image retrieval is described. Both the stored image 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 nonlinear correlation technique which has a superior performance compared with the conventional optical correlation techniques in the areas of the light efficiency and the correlation signal quality. Thus, better quality images can be reconstructed and the need for optical gain and the optical feedback may be eliminated. There are small losses in the system since no halograms are employed.