  We have combined the semi-analytic galaxy formation model of Guo et al.
(2011) with the particle-tagging technique of Cooper et al. (2010) to predict
galaxy surface brightness profiles in a representative sample of ~1900 massive
dark matter haloes (10^12--10^14 M_sol) from the Millennium II Lambda-CDM
N-body simulation. Here we present our method and basic results focusing on the
outer regions of galaxies, consisting of stars accreted in mergers. These
simulations cover scales from the stellar haloes of Milky Way-like galaxies to
the 'cD envelopes' of groups and clusters, and resolve low surface brightness
substructure such as tidal streams. We find that the surface density of
accreted stellar mass around the central galaxies of dark matter haloes is well
described by a Sersic profile, the radial scale and amplitude of which vary
systematically with halo mass (M_200). The total stellar mass surface density
profile breaks at the radius where accreted stars start to dominate over stars
formed in the galaxy itself. This break disappears with increasing M_200
because accreted stars contribute more of the total mass of galaxies, and is
less distinct when the same galaxies are averaged in bins of stellar mass,
because of scatter in the relation between M_star and M_200. To test our model
we have derived average stellar mass surface density profiles for massive
galaxies at z~0.08 by stacking SDSS images. Our model agrees well with these
stacked profiles and with other data from the literature, and makes predictions
that can be more rigorously tested by future surveys that extend the analysis
of the outer structure of galaxies to fainter isophotes. We conclude that it is
likely that the outer structure of the spheroidal components of galaxies is
largely determined by collisionless merging during their hierarchical assembly
