We describe a new technique for measuring accurate galaxy colours from images taken under different seeing conditions. The method involves two ingredients. First we define the Gaussian-aperture-and-PSF flux, which is the Gaussian-weighted flux a galaxy would have if it were observed with a Gaussian PSF. This theoretical aperture flux is independent of the PSF or pixel scale that the galaxy was observed with. Second we develop a procedure to measure such a `GaaP' flux from observed, pixellated images. This involves modelling source and PSF as a superposition of orthogonal shapelets. A correction scheme is also described, which approximately corrects for any residuals to the shapelet expansions. A series of tests on simulated images shows that with this method it is possible to reduce systematic errors in the matched-aperture fluxes to a percent, which makes it useful for deriving photometric redshifts from large imaging surveys.