The performance of imaging systems is inevitably degraded by aberrations of optical systems. Furthermore, images detected by long-distance imaging schemes also suffer blurring induced by atmospheric turbulence. To address this problem, we propose and demonstrate an aberration-free imaging procedure in this paper, which is termed pupil-size diversity technology. With no additional optical element, the reported technique first acquires several intensity images only by simply resizing the pupil of an imaging system. The spatial difference of pupil areas generates pupil diversity. Then, based on the nonlinear optimization method, a high-quality image eliminating distortions can be reconstructed by processing the multiple diversity images with the stochastic parallel gradient descent algorithm. Comparative results of simulations and experiments, for correcting inner and external aberrations, respectively, verify the validity. The proposed technology in this paper may provide an alternative for adaptive optics systems and find wide applications in computational photography and remote sensing.