This is likely best done as an inverse convolution or correlation. Numpy/scipy has code to do both.
edit: including a little example.
Go here for the ipython notebook file: http://nbviewer.ipython.org/4020770/
I made a little gaussian and then use scipy.signal.correlate2d with the original image and a small subset.
you can see that the highest values of the correlation are centered around where the subset of the image was taken. note that for large kernels or images, this code can take a while (because correlation is expensive)