We present an efficient algorithm for fusing a pair of long- and short-exposure images that work in the JPEG domain. The algorithm uses the spatial frequency analysis provided by the discrete cosine transform within JPEG to combine the uniform regions of the long-exposure image with the detailed regions of the short-exposure image, thereby reducing noise while providing sharp details. Two additional features of the algorithm enable its implementation at low cost, and in real time, on a digital camera: the camera’s response between exposures is equalized with a look-up table implementing a parametric sigmoidal function; and image fusion is performed by selective overwriting during the JPEG file save operation. The algorithm requires no more than a single JPEG macro-block of the short-exposure image to be maintained in RAM at any one time, and needs only a single pass over both long- and short-exposure images. The performance of the algorithm is demonstrated with examples of image stabilization and high dynamic range image acquisition.