Convolution between image $f(x, y)$ and kernel $k(x, y)$ is
\[
f(x,y)\ast k(x, y) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(u, v)k(x-u, y-v) \,du \,dv\\
\mbox{In Descrete Form}\\
f(x, y) \ast k(x, y) = \sum_{i=0}^{W-1} \sum_{j=0}^{H-1} f(i, j)k(x-i, y-j) \\
\mbox{Where W and H is the Width and Height of an image}\\
\]