In a comment you say (I fixed a few words in this quote) "If it was a neutron star an atom would lose its electrons and protons before becoming a part of that star"... And in the question you say, "Are photons absorbed by atoms compressed out by gravity".
This reminds me of Feynman's father. If you Google "feynman father photon", you should find the story of how Feynman's father thought that the photon that an atom emits, was already in the atom before it was emitted. According to the story, Feynman said no, it's not, but then he couldn't explain the way it actually works.
In this case, I think the simplest way to think about it, is that the electromagnetic field is everywhere, and a photon is an excitation of the electromagnetic field that carries energy. And so when an atom absorbs a photon, what happens is that the energy in the photon is transferred to the atom, and the photon no longer exists. And when an atom emits a photon, energy in the atom is being transferred to the local part of the electromagnetic field, creating a photon.
Also, a neutron star isn't created by the atoms of the collapsing star losing their protons and electrons. The protons actually turn into neutrons too (this involves the quarks) and the electrons turn into neutrinos and escape into space:
What happens to Protons and Electrons when a Neutron star forms?