Resonant conversion of high energy gravitons into photons in large scale cosmological magnetic fields at the post-recombination epoch is considered. It is shown that the probability of the resonance photon production is much higher than the nonresonant one. As a result, an observable isotropic background of cosmic gamma rays might be created. As shown in our previous paper, an early population of primordial black holes prior to big bang nucleosynthesis could be an efficient source of high frequency gravitational waves. For the primordial black hole mass, about 10(8) g, the produced photons would be the dominant component of the soft to hard cosmic x-ray background and for lower masses the spectrum is shifted down to the ultraviolet and optic.