A method used for the compensation of vignetting in digital cameras has
been achieved. The compensation for vignetting is done in two steps. The
first step is done during production of the camera unit and involves
taking and analyzing an image of a test screen, preferably a gray test
screen. This results in a set of e.g. 5.times.5 coefficients describing a
polynomial surface. The second step is done for each image that is taken
by the camera and involves calculating and applying a gain-table based on
polynomial coefficients to all pixels of the image to compensate
vignetting.