Possible solution:
* With the color picker, sample the lightest and darkest background color, and assign them to the FG and BG colors
* Add a layer filled with white, and set it to Divide mode (so the end result is your initial image)
* Set the gradient to FG to BG (RGB)
* Create the gradient between your two sample points. In Gimp 2.10, you can adjust the position of the gradient endpoints to get the best match. And if your light source was close, using a radial gradient (centered on the lightest point) could be an even better approximation (done below)
* If the effect is too strong, reduce the opacity of the the "Divide" later
* With the color picker, sample the lightest and darkest background color, and assign them to the FG and BG colors
* Add a layer filled with white, and set it to Divide mode (so the end result is your initial image)
* Set the gradient to FG to BG (RGB)
* Create the gradient between your two sample points. In Gimp 2.10, you can adjust the position of the gradient endpoints to get the best match. And if your light source was close, using a radial gradient (centered on the lightest point) could be an even better approximation (done below)
* If the effect is too strong, reduce the opacity of the the "Divide" later
This said, as an amateur photographer, I would say that you could avoid the problem with a light source farther away or with a big diffuser/lightbox.