We study experimentally and numerically the equilibrium density profiles of a trapped two-dimensional $^{87}$Rb Bose gas, and investigate the equation of state of the homogeneous system using the local density approximation. We find a clear discrepancy between in-situ measurements and Quantum Monte Carlo simulations, which we attribute to a non-linear variation of the optical density of the atomic cloud with its spatial density. However, good agreement between experiment and theory is recovered for the density profiles measured after time-of-flight, taking advantage of their self-similarity in a two-dimensional expansion.