Aims. We develop a code, the BatImager, for efficient data processing and image reconstruction of the Swift-BAT survey data. Methods. The software performs image reconstruction via the cross-correlation method and also generates source spectra and light curves. The software is optimized for the direct production of all-sky mosaics on an equi-area spherical grid. To reduce systematic errors, we perform an accurate inflight calibration of the instrument, producing an improved description of the mask pattern, timedependent pixel equalization maps, boresight misalignment correction, and energy dependent off-axis count rate correction. Results. The software is fully tested and used for the analysis of BAT survey data, demonstrating that the BatImager is competitive in exploiting the BAT capabilities both for sensitivity and for position reconstruction.