The Karhunen-Loeve (K-L) expansion is largerly used in digital picture compression. We present a new algorithm to compute the K-L eigenfunctions and eigenvalues for a Gaussian stochastic process whose time elapses according to an arbitrary law rather than uniformly. These eigenfunctions are proved to be time-rescaled Bessel functions of the first kind having their order depending on the time. The K-L eigenvalues are proved to be the zeros of a linear combination involving the Bessel functions and their partial derivatives of the first order. Also, a study is made of the energy of the time-rescaled Gaussian processes, and we show that the analytical treatment can be pushed up to the cumulants of the energy distribution. Moreover, we have found the relationship between the time-rescaling function and the velocity of a relativistically moving body, that is, we have related the K-L expansion to both the special and the general theory of relativity. This appears to pave the way to a general method for the K-L compression in the digital picture processing of a relativistic source.