  The limited dynamic range of the detector can impede coherent diffractive
imaging (CDI) schemes from achieving diffraction-limited resolution. To
overcome this limitation, a straightforward approach is to utilize high dynamic
range (HDR) imaging through multi-exposure image fusion (MEF). This method
involves capturing measurements at different exposure times, spanning from
under to overexposure and fusing them into a single HDR image. The conventional
MEF technique in ptychography typically involves subtracting the background
noise, ignoring the saturated pixels and then merging the acquisitions.
However, this approach is inadequate under conditions of low signal-to-noise
ratio (SNR). Additionally, variations in illumination intensity significantly
affect the phase retrieval process. To address these issues, we propose a
Bayesian MEF modeling approach based on a modified Poisson distribution that
takes the background and saturation into account. To infer the model
parameters, the expectation-maximization (EM) algorithm is employed. As
demonstrated with synthetic and experimental data, our approach outperforms the
conventional MEF method, offering superior phase retrieval under challenging
experimental conditions. This work underscores the significance of robust
multi-exposure image fusion for ptychography, particularly in imaging
shot-noise-dominated weakly scattering specimens or in cases where access to
HDR detectors with high SNR is limited. Furthermore, the applicability of the
Bayesian MEF approach extends beyond CDI to any imaging scheme that requires
HDR treatment. Given this versatility, we provide the implementation of our
algorithm as a Python package.
