Large-aperture, lightweight, and high-resolution imaging are hallmarks of major optical systems. To eliminate aberrations, traditional systems are often bulky and complex, whereas the small volume and light weight of diffractive lenses position them as potential substitutes. However, their inherent diffraction mechanism leads to severe dispersion, which limits their application in wide spectral bands. Addressing the dispersion issue in diffractive lenses, we propose a chromatic aberration correction algorithm based on compressed sensing. Utilizing the diffractive lens’s focusing ability at the reference wavelength and its degradation performance at other wavelengths, we employ compressed sensing to reconstruct images from incomplete image information. In this work, we design a harmonic diffractive lens with a diffractive order of M=150, an aperture of 40 mm, a focal length f0=320 mm, a reference wavelength λ0=550 nm, a wavelength range of 500–800 nm, and 7 annular zones. Through algorithmic recovery, we achieve clear imaging in the visible spectrum, with a peak signal-to-noise ratio (PSNR) of 22.85 dB, a correlation coefficient of 0.9596, and a root mean square error (RMSE) of 0.02, verifying the algorithm’s effectiveness.