Shading is a prominent phenomenon in microscopy, reflecting the inherent imperfections of the image formation process and manifesting itself via spurious intensity variations not present in the original scene. The elimination of shading effects is frequently necessary for subsequent image processing tasks, especially if quantitative analysis is the final goal. In this paper a novel method for retrospective shading correction is proposed. First, the image formation process and the corresponding shading effects are described by a linear image formation model, consisting of an additive and a multiplicative shading component that are modeled by the parametric polynomial surfaces. Second, shading correction is performed by the inverse of the image formation model, whose shading components are estimated retrospectively by minimizing the entropy of the acquired images. The method was qualitatively and quantitatively evaluated by using artificial and real microscopical images of muscle fibers. A number of qualitative results confirmed that entropy is an appropriate measure for shading correction. Quantitative results indicate that the method does not introduce additional intensity variations but only reduces them if they exist. In conclusion, the proposed method uses all the information available in the images, it enables the optimization of arbitrarily complex image formation models, and as such may have applications in and beyond the field of microscopical imaging, for example, in MRI.