It’s a little bit of both, I believe. There’s a myriad of methods to coloring these images; but most of the ones that come out of credited sources are pretty accurate!
They assign colors to certain wavelengths of light; or run them through filters that imitate our cones’ perception of color
This infrared image from NASA's Spitzer Space Telescope of the Helix Nebula depicts a bunch of rowdy comets colliding and kicking up dust around a dead star.
Comments
They assign colors to certain wavelengths of light; or run them through filters that imitate our cones’ perception of color
Credit: NASA/JPL-Caltech/Univ.of Ariz.