  Photometric redshifts are necessary for enabling large-scale multicolour
galaxy surveys to interpret their data and constrain cosmological parameters.
While the increased depth of future surveys such as the Large Synoptic Survey
Telescope (LSST) will produce higher precision constraints, it will also
increase the fraction of sources that are blended. In this paper, we present a
Bayesian photometric redshift method for blended sources with an arbitrary
number of intrinsic components. This method generalises existing template-based
Bayesian photometric redshift (BPZ) methods, and produces joint posterior
distributions for the component redshifts that allow uncertainties to be
propagated in a principled way. Using Bayesian model comparison, we infer the
probability that a source is blended and the number of components that it
contains. We extend our formalism to the case where sources are blended in some
bands and resolved in others. Applying this to the combination of LSST- and
Euclid-like surveys, we find that the addition of resolved photometry results
in a significant improvement in the reduction of outliers over the
fully-blended case. We make available blendz, a Python implementation of our
method.
