Reduced leakage current, enhanced ferroelectric and dielectric properties in (Ce,Fe)-codoped Na0.5Bi0.5TiO3 film Appl. Phys. Lett. 100, 022909 (2012) Modified Johnson model for ferroelectric lead lanthanum zirconate titanate at very high fields and below Curie temperature Appl. Phys. Lett. 100, 022907 (2012) Engineering titanium and aluminum oxide composites using atomic layer deposition J. Appl. Phys. 110, 123514 (2011) High dielectric tunability of (100) oriented PbxSr1xTiO3 thin film coordinately controlled by dipole activation and phase anisotropy J. Appl. Phys. 110, 124107 (2011) Kelvin probe force gradient microscopy of charge dissipation in nano thin dielectric layers J. Appl. Phys. 110, 084304 (2011) Additional information on Rev. Sci. Instrum. Kelvin probe force microscopy ͑KPFM͒ is designed for measuring the tip-sample contact potential differences by probing the sample surface, measuring the electrostatic interaction, and adjusting a feedback circuit. However, for the case of a dielectric ͑insulating͒ sample, the contact potential difference may be ill defined, and the KPFM probe may be sensing electrostatic interactions with a certain distribution of sample trapped charges or dipoles, leading to difficulty in interpreting the images. We have proposed a general framework based on boundary integral equations for simulating the KPFM image based on the knowledge about the sample charge distributions ͑forward problem͒ and a deconvolution algorithm solving for the trapped charges on the surface from an image ͑inverse problem͒. The forward problem is a classical potential problem, which can be efficiently solved using the boundary element method. Nevertheless, the inverse problem is ill posed due to data incompleteness. For some special cases, we have developed deconvolution algorithms based on the forward problem solution. As an example, this algorithm is applied to process the KPFM image of a gadolinia-doped ceria thin film to solve for its surface charge density, which is a more relevant quantity for samples of this kind than the contact potential difference ͑normally only defined for conductive samples͒ values contained in the raw image.