so is there a formula that can be automatically applied to restore the original colors? at least some reasonable approximation, based on the painting's age?
There has been some research on what causes degradation on paper/pigment but as far as I know much of it ends up as a mystery, a fact of time...