Abstract. In the past twenty years, CCD sensor technology has made significant progress in increasing resolution and improving low-light performance by hardware. However due to physical limits of the sensor design and fabrication, fill factor has become the bottle neck problem for improving quantum efficiency of CCD sensor in order to widen dynamic range of output image. In this paper we propose a novel software-based method to compensate the performance degradation of the dynamic range, by virtual increase of fill factor which is achieved by a resampling process. In our method, the CCD sensor images are rearranged to a new grid of virtual sensor pixels, each of which is composed by subpixels. A statistical framework consisting of local learning model, simulations and Bayesian inference is used to estimate new subpixel intensity values. The highest probability of sub-pixels intensity values in each resampled pixel area is used to estimate the pixel intensity values of a new dynamic range enhanced image.From generation of gray level optical images, CCD images with different fill factors were obtained. By knowing the fill factor and having the CCD image, a new resampled image was computed. Each resampled image was compared to the respective CCD and optical image. The results of such comparison show that by using the proposed method it is possible to widen significantly the recordable dynamic range of CCD images and obtain a virtual increase of fill factor to 100%. The stability and fill factor dependency of the proposed method were also examined in which the results showed insignificant spreading effect and fill factor dependency.