We present a method for obtaining the likelihood function of distance and extinction to a star given its photometry. The other properties of the star (its mass, age, metallicity and so on) are marginalised assuming a simple Galaxy model. We demonstrate that the resulting marginalised likelihood function can be described faithfully and compactly using a Gaussian mixture model. For dust mapping applications we strongly advocate using monochromatic over bandpass extinctions, and provide tables for converting from the former to the latter for different stellar types.