This paper describes the MegaPipe image processing pipeline at the Canadian Astronomical Data Centre (CADC). The pipeline takes multiple images from the MegaCam mosaic camera on CFHT and combines them into a single output image. MegaPipe takes as input detrended MegaCam images and does a careful astrometric and photometric calibration on them. The calibrated images are then resampled and combined into image stacks. MegaPipe is run on PI data by request, data from large surveys (the CFHT Legacy Survey and the Next Generation Virgo Survey) and all non-proprietary MegaCam data in the CFHT archive. The stacked images and catalogs derived from these images are available through the CADC website. Currently, over 1200 square degrees have been processed.