Deriving the frequency spectrum graph from the graph of a spectrogram and vice versa?
The data that when colored produces one vertical slice of your spectrogram image is a spectrum.  If you have the color mapping function, and it is invertible, you could take the array of colors from one vertical column in a spectrogram and attempt to produce the original spectrum for that point in time.  But the inversion process would likely be lossy, since there are usually less quantized colors than spectrum amplitudes.

Since a spectrum is only one vertical slice of a spectrogram, a spectrogram produced from just one spectrum would only be something like 1 pixel wide, thus not very useful.  But a bunch of spectrums at evenly spaced time increments could be used to produce a wider spectrogram.

Also note that due to time-frequency-resolution trade-offs, the width of time data used for each FFT/DFT spectrum array can be different between spectrum and spectrogram analysis presentations.