This document presents a novel variation of the Richardson-Lucy algorithm for image restoration that uses a varying point spread function (PSF) throughout the iterative process to improve image quality. By adjusting the PSF based on the achieved resolution and maximizing the global contrast, the proposed method significantly outperforms the conventional approach, which relies on a constant PSF. The algorithm has been integrated into a Fortran 90 program for the generation and processing of both synthetic and experimental images, demonstrating superior restoration capabilities.