The median pixel value in the region surrounding each input image pixel is calculated. This value is then subtracted from the value of the pixel being considered. Finally, the original background count is added to the result, which is placed in the corresponding pixel of the output image.
ESP --- Extended Surface Photometry