You could calculate the brightness of every Pixel with a
2-dimensional Gaussian function.
Here is some Pseudocode:
Delphi-Quellcode:
xcenter := Bitmap.Width div 2;
ycenter := Bitmap.Height div 2;
for each Pixel do
begin
brightness_factor := mygaussian(x - xcenter, y-ycenter)* 0.5{=effect depth} + 0.3{basic brightness};
Pixel[x,y].red := Pixel[x,y].red * brightness_factor;
Pixel[x,y].green := Pixel[x,y].green * brightness_factor;
Pixel[x,y].blue := Pixel[x,y].blue * brightness_factor;
end;
It it works, you could replace the mygaussian() function with other possibly better functions.