Density of stars on celestial sphere
If stars are uniformly distributed with density $\rho$ per cubic parsec, out to a distance $d$ parsecs, then that volume contains $4\pi \rho d^3/3$ stars spread over the whole sky.
The angular size of the whole sky is 41,252.96125 square degrees, so you would divide by that number to estimate the stellar density in stars per square degree.
This assumes that you can see all the stars. In practice you cannot, because of dust extinction and because stars become fainter the further away they are. You can account for these in any calculation but the details depend on the luminosity function of the stars, the distribution of dust and the instrumental properties of the telescope/detector used to take the picture.