Inhomogeneous illumination occurs in nearly every image acquisition system and can hardly be avoided simply by improving the quality of the hardware and the optics. Therefore, software solutions are needed to correct for inhomogeneities, which are particularly visible when combining single images to larger mosaics, e.g. when wrapping textures onto surfaces. Various methods to remove smoothly varying image gradients are available, but often produce artifacts at the image boundary. We present a novel correction method for compensating these artifacts based on the Gaussian pyramid and an appropriate extrapolation of the image boundary. Our framework provides various extrapolation methods and reduces the illumination correction error significantly. Moreover, the correction is done in real-time for high-resolution images and is part of an application for virtual material design.